sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
WaveFile::ChunkReaders::DataChunkReader#convert_24_bit_samples
Since Ruby doesn't have a way to natively extract 24-bit values using pack/unpack, unsigned bytes are read instead, and then every 3 is manually combined into a signed 24-bit integer. Since the sample data is little endian, the 3 bytes will go from least->most significant
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/chunk_readers/data_chunk_reader.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-WaveFile--ChunkReaders--DataChunkReader-convert_24_bit_samples-for-pr
# Commit to gitgit add app/server/ruby/vendor/wavefile-0.8.1/lib/wavefile/chunk_readers/data_chunk_reader.rbgit commit -m "better docs for WaveFile::ChunkReaders::DataChunkReader#convert_24_bit_samples"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-WaveFile--ChunkReaders--DataChunkReader-convert_24_bit_samples-for-pr
hub pull-request
# Celebrate!