Project

awaaz

0.0
The project is in a healthy, maintained state
A gem for loading, decoding, processing and analyse audio.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 1.17.2
~> 0.9.1
 Project Readme

Awaaz

Awaaz is a Ruby gem for working with audio, from decoding to analysis, making it easier to process and understand sound in your projects.

Requirements

Awaaz can decode audio in two ways:

1. Shell-based decoding

You can install any one of the following:

  • ffmpeg – supports most formats, including MP3.
  • sox – also supports most formats, including MP3.
  • mpg123MP3 only.

2. Library-based decoding and resampling

  • libsndfile – reads audio files (but cannot read MP3 files).
  • libsamplerate – resamples audio samples when using libsndfile.

Important:

  • If you need MP3 support with the library-based method, you must also install one of:
    • ffmpeg
    • sox
    • mpg123

Additional Requirement

  • The Ruby gem numo-narray is required for numerical array operations.

Installation Examples

  • Just ffmpeg → works for all formats (no libsndfile or libsamplerate needed).
  • Just sox → works for all formats (no libsndfile or libsamplerate needed).
  • libsndfile + libsamplerate → works for non-MP3 formats. For MP3, add ffmpeg, sox, or mpg123.
  • Everything installed → maximum flexibility.

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add awaaz

If bundler is not being used to manage dependencies, install the gem by executing:

gem install awaaz

Usage

# To decode the audio file
samples, sample_rate = Awaaz.load("path/to/audio_file")

# To decode the audio file using specified decoder
samples, sample_rate = Awaaz.load("path/to/audio_file", decoder: :sox)

Development

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.

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.