7 #ifndef CSL_SoundFileJ_H
8 #define CSL_SoundFileJ_H
11 #include "../JuceLibraryCode/JuceHeader.h"
39 unsigned rate = 44100,
void writeBuffer(Buffer &inputBuffer)
write a buffer of data into the file
juce::AudioFormatReader * mAFReader
my reader
SeekPosition
Enumeration for seek flags.
#define kSoundFileFormatAIFF
JSoundFile(string path, int start=-1, int stop=-1)
C'tors.
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
unsigned duration() const
number of frames in the sound file
juce::File * mIOFile
my JUCE file
void readBufferFromFile(unsigned numFrames)
read a buffer from the file (possibly all of it)
void openForRead(bool load=true)
void openForWrite(SoundFileFormat format=kSoundFileFormatAIFF, unsigned channels=1, unsigned rate=44100, unsigned bitDepth=16)
Open a file for write. Default values are some common format.
void initFromSndfile()
read SF header
juce::AudioFormatWriter * mAFWriter
and my writer
void close()
close file seek to some position
juce::FileOutputStream * mOutStream
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
SoundFileFormat format()
get format open file and get stats
Here's the abstract sound file reader/writer class, a sample player UGen. The concrete subclasses rep...
unsigned channels() const
accessors
static JSoundFile * openSndfile(string path, int start=-1, int stop=-1, bool doRead=true)
Factory methods.
void openForReadWrite()
open r/w
Base class of CSL exceptions (written upper-case). Has a string message.
unsigned seekTo(int position, SeekPosition whence)
sampleBufferPtr = mWavetable.buffer(channelIndex) + start;