AlsaBackup

DESCRIPTION:

ALSA client to perform continuous recording

FEATURES/PROBLEMS:

  • configurable file name strategy

SYNOPSIS:

By using the default settings :

alsa-backup

will record in record.wav the default alsa device

By using command line arguments :

alsa-backup --directory=/tmp --file=test.wav --length=2

will record 2 seconds in /tmp/test.wav

By loading a configuration :

alsa-backup --config=/path/to/config

will load the specified configuration

CONFIGURATION:

The configuration file is a Ruby file. This piece of code can configurate the AlsaBacup recorder :

AlsaBackup.config do |recorder|
  # configure recorder here :
  recorder.file = "record.wav"
end

Recorder File

The recorder file can be specified as a simple string :

recorder.file = "record.wav"

The recorder file can be specified by a Proc which returns the string :

recorder.file = Proc.new {
  Time.now.strftime("%Y/%m-%b/%d-%a/%Hh.wav")
}

will use the current time to create file names like these :

2009/05-May/17-Sun/19h.wav
2009/05-May/17-Sun/20h.wav

To use different files every 15 minutes :

recorder.file = Proc.new {
  Time.now.floor(:min, 15).strftime("%Y/%m-%b/%d-%a/%Hh%M.wav")
}

will create files like these :

2009/05-May/17-Sun/19h00.wav
2009/05-May/17-Sun/19h15.wav

See config.sample.

REQUIREMENTS:

INSTALL:

sudo apt-get install libasound2 libsndfile1
sudo gem install --source http://gemcutter.org alsa-backup

LICENSE:

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General public License for more details.

You should have received a copy of the GNU General public License along with this program. If not, see <www.gnu.org/licenses/>.