Go to the documentation of this file.
14 #ifndef CSL_SoundFile_H
15 #define CSL_SoundFile_H
28 #ifdef CSL_ENUMS // use enumerations or integers?
54 #define kSoundFileRead 0
55 #define kSoundFileWrite 1
56 #define kSoundFileReadWrite 2
59 #define kSoundFileFormatWAV 0
60 #define kSoundFileFormatAIFF 1
61 #define kSoundFileFormatSND 2
62 #define kSoundFileFormatEBICSF 3
63 #define kSoundFileFormatRaw 4
64 #define kSoundFileFormatOther 5
113 unsigned rate = 44100,
114 unsigned bitDepth = 16)
throw (
CException) = 0;
141 virtual void close() = 0;
148 virtual bool isCached(
unsigned samps);
150 virtual void setPath(
string path);
188 void checkBuffer(
unsigned numChans,
unsigned numFrames);
209 void readFrom(FILE *input);
224 #ifdef USE_SNDFILEBUFFER
230 class SoundFileBuffer :
public Buffer {
237 virtual SampleBuffer samplePtrFor(
unsigned channel,
unsigned offset);
239 virtual SampleBuffer samplePtrFor(
unsigned channel,
unsigned offset,
unsigned maxFrame);
242 virtual SampleBuffer monoBuffer(
unsigned bufNum) {
return mBuffers[bufNum]; }
246 virtual void setBuffer(
unsigned bufNum,
SampleBuffer sPtr) {
247 throw LogicError(
"Cannot set pointer to file buffer"); };
248 virtual void setBuffer(
unsigned bufNum,
unsigned offset,
sample samp) {
249 throw LogicError(
"Cannot set pointer to file buffer"); };
262 #ifdef UNDEFINED // this was never completed...
267 SampleFile(
string name,
Abst_SoundFile *file = 0,
int start = 1,
int stop = -1);
275 double ratioForKey(
int desiredMIDI);
276 double ratioForPitch(
int desiredMIDI);