albanpeignier / alsa-backup

Alsa Client to perform continuous recording

This URL has Read+Write access

name age message
file .autotest Wed May 20 12:48:19 -0700 2009 Add Record#error_handler [albanpeignier]
file .gitignore Tue Sep 15 11:02:43 -0700 2009 Add rcov rake task and complete Record and Leng... [albanpeignier]
file History.txt Sun May 31 03:43:13 -0700 2009 Make configurable channels, sample rate and als... [albanpeignier]
file Manifest.txt Wed Sep 16 09:26:36 -0700 2009 Rename executable into alsa-backup [albanpeignier]
file PostInstall.txt Thu May 14 00:09:50 -0700 2009 Initial files (mostly generated by newgem) [albanpeignier]
file README.rdoc Wed Sep 16 09:26:36 -0700 2009 Rename executable into alsa-backup [albanpeignier]
file Rakefile Wed Sep 16 09:54:20 -0700 2009 Updade debian increment in Rakefile [albanpeignier]
file TODO Tue Sep 15 01:18:01 -0700 2009 Load hoe into Rakefile [albanpeignier]
file alsa-backup.gemspec Wed Sep 16 09:26:36 -0700 2009 Rename executable into alsa-backup [albanpeignier]
directory bin/ Wed Sep 16 09:26:36 -0700 2009 Rename executable into alsa-backup [albanpeignier]
file config.sample Wed Sep 16 09:26:36 -0700 2009 Rename executable into alsa-backup [albanpeignier]
directory debian/ Wed Sep 16 09:26:36 -0700 2009 Rename executable into alsa-backup [albanpeignier]
directory lib/ Wed Sep 16 09:46:20 -0700 2009 Interrupt record loop on SignalException [albanpeignier]
directory refs/ Fri May 22 08:52:54 -0700 2009 Add sndfile example (make_sine.c) to refs [albanpeignier]
directory script/ Thu May 14 00:09:50 -0700 2009 Initial files (mostly generated by newgem) [albanpeignier]
file setup.rb Wed Sep 16 01:06:00 -0700 2009 Add setup.rb [albanpeignier]
directory spec/ Tue Sep 15 11:02:43 -0700 2009 Add rcov rake task and complete Record and Leng... [albanpeignier]
directory tasks/ Tue Sep 15 11:02:43 -0700 2009 Add rcov rake task and complete Record and Leng... [albanpeignier]
README.rdoc

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://gems.github.com albanpeignier-alsa-backup

LICENSE:

(The MIT License)

Copyright © 2009 Alban Peignier

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.