Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

sndfile

  1. Outdated egg!
  2. sndfile
  3. Documentation
  4. API
  5. Author
  6. Repository

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