#include <SoundFileJ.h>

Public Member Functions | |
| JSoundFile (string path, int start=-1, int stop=-1) | |
| JSoundFile (string folder, string path, int start=-1, int stop=-1) | |
| JSoundFile (JSoundFile &otherSndFile) | |
| Copy constructor -- shares sample buffer. | |
| ~JSoundFile () | |
| unsigned | duration () const |
| number of frames in the sound file | |
| SoundFileFormat | format () |
| get format | |
| void | openForRead () throw (CException) |
| void | openForWrite (SoundFileFormat format=kSoundFileFormatAIFF, unsigned channels=1, unsigned rate=44100, unsigned bitDepth=16) throw (CException) |
| Open a file for write. Default values are some common format. | |
| void | openForReadWrite () throw (CException) |
| open r/w | |
| void | close () |
| unsigned | seekTo (int position, SeekPosition whence) throw (CException) |
| seek to some position | |
| void | readBufferFromFile (unsigned numFrames) |
| read a buffer from the file (possibly all of it) | |
| void | writeBuffer (Buffer &inputBuffer) throw (CException) |
| write a buffer of data into the file | |
Public Attributes | |
| AudioFormatReader * | mAFReader |
| my reader | |
| AudioFormatWriter * | mAFWriter |
| and my writer | |
| File * | mIOFile |
| my JUCE file | |
| FileOutputStream * | mOutStream |
Protected Member Functions | |
| void | initFromSndfile () |
| read SF header | |
| JSoundFile::JSoundFile | ( | string | path, | |
| int | start = -1, |
|||
| int | stop = -1 | |||
| ) |
| JSoundFile::JSoundFile | ( | string | folder, | |
| string | path, | |||
| int | start = -1, |
|||
| int | stop = -1 | |||
| ) |
| JSoundFile::JSoundFile | ( | JSoundFile & | otherSndFile | ) |
Copy constructor -- shares sample buffer.
| JSoundFile::~JSoundFile | ( | ) |
| unsigned JSoundFile::duration | ( | ) | const [virtual] |
| SoundFileFormat JSoundFile::format | ( | ) | [virtual] |
get format
Implements csl::Abst_SoundFile.
References testkiss::fmt, kSoundFileFormatAIFF, kSoundFileFormatOther, kSoundFileFormatWAV, and mAFReader.
| void JSoundFile::openForRead | ( | ) | throw (CException) [virtual] |
open file and get stats Open a file for write. Default values are some common format.
Implements csl::Abst_SoundFile.
References initFromSndfile(), csl::kLogError, kSoundFileRead, csl::logMsg(), mAFReader, csl::CGestalt::maxSndFileFrames(), csl::Seekable::mCurrentFrame, mIOFile, csl::Abst_SoundFile::mIsValid, csl::Abst_SoundFile::mMode, csl::Abst_SoundFile::mNumFrames, csl::Abst_SoundFile::mPath, csl::Abst_SoundFile::mStart, and readBufferFromFile().
| void JSoundFile::openForWrite | ( | SoundFileFormat | format = kSoundFileFormatAIFF, |
|
| unsigned | channels = 1, |
|||
| unsigned | rate = 44100, |
|||
| unsigned | bitDepth = 16 | |||
| ) | throw (CException) [virtual] |
Open a file for write. Default values are some common format.
Implements csl::Abst_SoundFile.
References csl::kLogError, kSoundFileFormatAIFF, kSoundFileFormatWAV, kSoundFileWrite, and csl::logMsg().
| void csl::JSoundFile::openForReadWrite | ( | ) | throw (CException) |
open r/w
| void JSoundFile::close | ( | ) | [virtual] |
close file seek to some position
Implements csl::Abst_SoundFile.
References csl::Abst_SoundFile::freeBuffer().
| unsigned JSoundFile::seekTo | ( | int | position, | |
| SeekPosition | whence | |||
| ) | throw (CException) [virtual] |
seek to some position
Implements csl::Abst_SoundFile.
References csl::kPositionCurrent, csl::kPositionEnd, csl::kPositionStart, and csl::logMsg().
Referenced by initFromSndfile(), and readBufferFromFile().
| void JSoundFile::readBufferFromFile | ( | unsigned | numFrames | ) | [virtual] |
read a buffer from the file (possibly all of it)
Implements csl::Abst_SoundFile.
References csl::Abst_SoundFile::checkBuffer(), csl::kLogError, csl::kPositionStart, csl::logMsg(), mAFReader, csl::Buffer::mBuffers, csl::Seekable::mCurrentFrame, csl::Abst_SoundFile::mIsLooping, csl::UnitGenerator::mNumChannels, csl::Buffer::monoBuffer(), csl::Abst_SoundFile::mStop, csl::WavetableOscillator::mWavetable, and seekTo().
Referenced by openForRead().
| void JSoundFile::writeBuffer | ( | Buffer & | inputBuffer | ) | throw (CException) [virtual] |
write a buffer of data into the file
Implements csl::Abst_SoundFile.
References csl::kLogError, and csl::logMsg().
| void JSoundFile::initFromSndfile | ( | ) | [protected, virtual] |
read SF header
Implements csl::Abst_SoundFile.
References csl::kPositionStart, mAFReader, csl::Abst_SoundFile::mBytesPerSample, csl::UnitGenerator::mFrameRate, csl::Abst_SoundFile::mIsValid, csl::UnitGenerator::mNumChannels, csl::Abst_SoundFile::mNumFrames, csl::Abst_SoundFile::mStart, csl::Abst_SoundFile::mStop, and seekTo().
Referenced by openForRead().
| AudioFormatReader* csl::JSoundFile::mAFReader |
my reader
Referenced by duration(), format(), initFromSndfile(), openForRead(), and readBufferFromFile().
| AudioFormatWriter* csl::JSoundFile::mAFWriter |
and my writer
| File* csl::JSoundFile::mIOFile |
| FileOutputStream* csl::JSoundFile::mOutStream |
1.5.8