sirens-ruby

sirens-ruby is a ruby extension for Sirens, a library for segmentation, indexing, and retrieval of environmental and natural sounds. Sirens is currently under development and only supports basic feature extraction. Please check back for updates.

Requirements

To install sirens-ruby, it is necessary to have these two libraries:

  1. FFTW
  2. Sirens

Additionally, sirens-ruby has the following gem dependencies, which RubyGems should take care of:

  1. rake-compiler
  2. jeweler
  3. rice Note: I've had some problems with installing the Rice 1.1.0 gem. Try 1.0.2 if it doesn't work.

Installation

To install Soundwalk, perform the following steps.

  1. git clone git://github.com/plant/sirens-ruby.git
  2. cd sirens-ruby
  3. rake compile
  4. rake build

OSX Note: Under OSX, you might get a warning about an unsupported architecture when compiling sirens-ruby, since Ruby will try to create a universal binary for the bundle, and FFTW and STK don't build universal binaries by default. For STK, in the future I may just include the necessary source in Sirens rather than linking against a library, as is conventional.

Usage

Sirens is pretty minimal at the moment and only supports the extraction of six basic features. In the future, Sirens will include feature-based segmentation and comparison.

Here is a basic example to extract loudness (dB) values from a sound file: require 'sirens'

s = Sirens::Sound.new
s.frameLength = 0.04
s.hopLength = 0.02

loudness = Sirens::LoudnessFeature.new
loudness.historySize = s.frames

s.sampleFeatures = Array[loudness]

s.extractFeatures

for value in loudness.history
    puts value
end

More detailed documentation is on the Wiki (http://wiki.github.com/plant/sirens-ruby). You can also check out test/soundwalk_test.rb for an example of extracting all six features with some default parameters.

Copyright

Copyright (c) 2009 Brandon Mechtley. See LICENSE for details.