Awaaz is a Ruby gem for working with audio, from decoding to analysis, making it easier to process and understand sound in your projects.
Awaaz can decode audio in two ways:
You can install any one of the following:
ffmpegโ supports most formats, including MP3.soxโ also supports most formats, including MP3.mpg123โ MP3 only.
libsndfileโ reads audio files (but cannot read MP3 files).libsamplerateโ resamples audio samples when usinglibsndfile.
โ Important:
- If you need MP3 support with the library-based method, you must also install one of:
ffmpegsoxmpg123
- The Ruby gem
numo-narrayis required for numerical array operations.
- Just ffmpeg โ works for all formats (no
libsndfileorlibsamplerateneeded). - Just sox โ works for all formats (no
libsndfileorlibsamplerateneeded). - libsndfile + libsamplerate โ works for non-MP3 formats. For MP3, add
ffmpeg,sox, ormpg123. - Everything installed โ maximum flexibility.
Install the gem and add to the application's Gemfile by executing:
bundle add awaazIf bundler is not being used to manage dependencies, install the gem by executing:
gem install awaaz# To decode the audio file
samples, sample_rate = Awaaz.load("path/to/audio_file")Checkout this demo to get more idea of some use cases of the gem
After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at Awaaz. This project is intended to be a safe, welcoming space for collaboration, and contributors.
The gem is available as open source under the terms of the MIT License.