sonic-pi

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

C++

Code. Music. Live.

WaveFile::Format#initialize

Constructs a new immutable Format.

channels - The number of channels in the format. Can either be a Fixnum 
           (e.g. 1, 2, 3) or the symbols :mono (equivalent to 1) or 
           :stereo (equivalent to 2).
format_code - A symbol indicating the format of each sample. Consists of 
              two parts: a format code, and the bits per sample. The valid 
              values are :pcm_8, :pcm_16, :pcm_32, :float_32, :float_64,
              and :float (equivalent to :float_32)
sample_rate - The number of samples per second, such as 44100

Examples

  format = Format.new(1, :pcm_16, 44100)
  format = Format.new(:mono, :pcm_16, 44100)  # Equivalent to above

  format = Format.new(:stereo, :float_32, 44100)
  format = Format.new(:stereo, :float, 44100)

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/format.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-WaveFile--Format-initialize-for-pr


# Commit to git

git add app/server/ruby/vendor/wavefile-0.8.1/lib/wavefile/format.rbgit commit -m "better docs for WaveFile::Format#initialize"


# 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--Format-initialize-for-pr

hub pull-request


# Celebrate!