sounding
A library for audio waveform manipulation
Installation
-
Add the dependency to your
shard.yml
:dependencies: sounding: github: aprildolly/sounding
-
Run
shards install
-
Install libsndfile development files. The package name is usually
libsndfile1-dev
-
Install rubberband if you want to use the pitch shifting or time stretching capabilities. You can either get the binaries here or install
rubberband-cli
via your package manager.
Usage
require "sounding"
include Sounding
#load sound from file
sound1=Sound.from_file("your_file.wav")
#create sound from slice
slice=Slice.new(3000,Int32.new(80000))
sample_rate=44100
channels=2
sound2=Sound.from_slice(slice,sample_rate,channels)
#superimpose multiple sound objects. sample rates are automatically changed to the first operand (in this case, that of sound1
sound3=sound1+sound2
#concatenate sound objects.
sound2<<sound1
#sample rates can also be changed manually. resampling is done automagically c:
sound3.samplerate=48000
#write sound to a new file
sound2.write("your_new_file.wav")
Development
TODO Write development instructions here
Contributing
- Fork it (https://github.com/your-github-user/sounding/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- April Dolly - creator and maintainer