You are looking at historical revision 34515 of this page. It may differ significantly from its current revision.

sndfile

Documentation

Wrapper for the sndfile library providing a simple and easy to use API.

API

[procedure] (with-sound-from-file file thunk)

Opens the file named by file for reading (the format is autodetected) and then executes thunk which is a procedure accepting five arguments:

[procedure] (with-sound-to-file file format samplerate channels thunk)

Opens the file named by file for writing using the specified parameters. Please refer to the previous section for more informations about the format of the parameters. The procedure thunk is then executed with a single argument handle.

[procedure] (read-items!/u8 handle buffer [n])
[procedure] (read-items!/s8 handle buffer [n])
[procedure] (read-items!/s16 handle buffer [n])
[procedure] (read-items!/s32 handle buffer [n])
[procedure] (read-items!/f32 handle buffer [n])
[procedure] (read-items!/f64 handle buffer [n])

Reads n items from the open file handle in buffer and returns the number of items read. The procedure is safe and it makes sure you're using the right kind of srfi-4 vector and that it is big enough to hold the data. Note that n is optional, by omitting it the library assumes you want to read enough data to fill the whole buffer.

[procedure] (write-items/u8 handle buffer [n])
[procedure] (write-items/s8 handle buffer [n])
[procedure] (write-items/s16 handle buffer [n])
[procedure] (write-items/s32 handle buffer [n])
[procedure] (write-items/f32 handle buffer [n])
[procedure] (write-items/f64 handle buffer [n])

Writes n items to the open file handle from buffer and returns the number of items written. The procedure is safe and it makes sure you're using the right kind of srfi-4 vector and that it holds enough data. Note that n is optional, by omitting it the library assumes you want to write out the whole buffer.

Author

LemonBoy

Repository

Github