sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

WaveFile::Reader#read

Reads the specified number of sample frames from the wave file into a Buffer. Note that the Buffer will have 
at most sample_frame_count sample frames, but could have less if the file doesn't have enough remaining.

sample_frame_count - The number of sample frames to read. Note that each sample frame includes a sample for 
                     each channel.

Returns a Buffer containing sample_frame_count sample frames
Raises UnsupportedFormatError if file is in a format that can't be read by this gem
Raises EOFError if no samples could be read due to reaching the end of the file

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/wavefile-0.8.1/lib/wavefile/reader.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-WaveFile--Reader-read-for-pr


# Commit to git

git add app/server/ruby/vendor/wavefile-0.8.1/lib/wavefile/reader.rbgit commit -m "better docs for WaveFile::Reader#read"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-WaveFile--Reader-read-for-pr

hub pull-request


# Celebrate!