sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
WaveFile::Reader#each_buffer
Reads sample data of the into successive Buffers of the specified size, until there is no more
sample data to be read. When all sample data has been read, the Reader is automatically closed.
Each Buffer is passed to the given block.
Note that sample_frame_count indicates the number of sample frames to read, not number of samples.
A sample frame include one sample for each channel. For example, if sample_frame_count is 1024, then
for a stereo file 1024 samples will be read from the left channel, and 1024 samples will be read from
the right channel.
sample_frame_count - The number of sample frames to read into each Buffer from each channel. The number
of sample frames read into the final Buffer could be less than this size, if there
are not enough remaining.
Returns nothing.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 branchgit checkout -b -your-name--update-docs-WaveFile--Reader-each_buffer-for-pr
# Commit to gitgit add app/server/ruby/vendor/wavefile-0.8.1/lib/wavefile/reader.rbgit commit -m "better docs for WaveFile::Reader#each_buffer"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-WaveFile--Reader-each_buffer-for-pr
hub pull-request
# Celebrate!