#include <SoundFile.h>
Inheritance diagram for csl::SoundFile:

Public Member Functions | |
| SoundFile (char *path) | |
| Constructor. Values not passed default to null. | |
| SoundFile (string path="", int start=-1, int stop=-1) | |
| ~SoundFile () | |
| unsigned | channels () const |
| accessors # chans | |
| unsigned | rate () const |
| frame rate | |
| unsigned | duration () const |
| number of frames in the sound file | |
| float | durationInSecs () |
| actual duration of the selected portion | |
| SoundFileFormat | format () const |
| get format | |
| bool | isValid () |
| answer if a valid file/buffer | |
| int | startFrame () |
| get/set start frame | |
| void | setStart (int val) |
| void | setStartSec (float val) |
| void | setStartRatio (float val) |
| int | stopFrame () |
| get/set stop frame | |
| void | setStop (int val) |
| void | setStopSec (float val) |
| void | setStopRatio (float val) |
| bool | isLooping () |
| get/set looping state | |
| void | setIsLooping (bool isLooping) |
| bool | isActive () |
| answer if currently active | |
| void | setPath (string path) |
| set file name path string | |
| void | openForRead () throw (CException) |
| void | openForWrite (SoundFileFormat format=kSoundFileFormatWAV, unsigned channels=1, unsigned rate=44100, unsigned bitDepth=16) throw (CException) |
| Open a file for write. Default values are chosen arbitrarily. Assumed as the minimum common used format. | |
| void | openForReadWrite () throw (CException) |
| unsigned | seekTo (int position, SeekPosition whence) throw (CException) |
| unsigned | seekTo (int position) throw (CException) |
| void | readBufferFromFile (unsigned numFrames) |
| read a buffer from the file (possibly all of it) | |
| void | setToEnd () |
| set to end position | |
| void | trigger () |
| reset to start | |
| void | close () |
| close file | |
| void | freeBuffer () |
| void | nextBuffer (Buffer &outputBuffer) throw (CException) |
| UGen operations copy next buffer from cache. | |
| void | writeBuffer (Buffer &inputBuffer) throw (CException) |
| write a buffer of data into the file | |
Public Attributes | |
| string | mPath |
| public state file name | |
| SoundFileMode | mMode |
| r/w mode | |
| SF_INFO | mSFInfo |
| libsndfile sf-info struct | |
| SNDFILE * | mSndfile |
| libsndfile handle | |
| Buffer | mSampleBuffer |
Protected Member Functions | |
| void | initFromSndfile () |
| read SF header | |
| void | checkBuffer (unsigned numFrames) |
| query cache status | |
Protected Attributes | |
| bool | mIsValid |
| is my file valid? | |
| bool | mIsLooping |
| am i looping start-stop? | |
| unsigned | mTempCurrentFrame |
| used in next buffer calculation | |
| int | mStart |
| int | mStop |
| starting/ending frames (or -1 if not used) | |
|
|
Constructor. Values not passed default to null.
|
|
||||||||||||||||
|
|
|
|
|
|
|
accessors # chans
|
|
|
frame rate
|
|
|
number of frames in the sound file
|
|
|
actual duration of the selected portion
|
|
|
get format
|
|
|
answer if a valid file/buffer
|
|
|
get/set start frame
|
|
|
|
|
|
|
|
|
|
|
|
get/set stop frame
|
|
|
|
|
|
|
|
|
|
|
|
get/set looping state
|
|
|
|
|
|
answer if currently active
|
|
|
set file name path string
|
|
|
open file and get stats |
|
||||||||||||||||||||
|
Open a file for write. Default values are chosen arbitrarily. Assumed as the minimum common used format.
|
|
|
open r/w seek to some position |
|
||||||||||||
|
|
|
|
|
|
|
read a buffer from the file (possibly all of it)
|
|
|
set to end position
|
|
|
reset to start
|
|
|
close file
|
|
|
free the file cache |
|
|
UGen operations copy next buffer from cache.
|
|
|
write a buffer of data into the file
|
|
|
read SF header
|
|
|
query cache status
|
|
|
public state file name
|
|
|
r/w mode
|
|
|
libsndfile sf-info struct
|
|
|
libsndfile handle
|
|
|
used to read in interleaved samples |
|
|
is my file valid?
|
|
|
am i looping start-stop?
|
|
|
used in next buffer calculation
|
|
|
|
|
|
starting/ending frames (or -1 if not used)
|
1.4.5-20051010