diff options
Diffstat (limited to 'src/uscxml/plugins/invoker/audio/LibSoundFile.cpp')
-rw-r--r-- | src/uscxml/plugins/invoker/audio/LibSoundFile.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp b/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp index 1340140..26d3328 100644 --- a/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp +++ b/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp @@ -7,39 +7,39 @@ LibSoundFile::LibSoundFile(const std::string filename) : PCMConverter() { _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 1, 44100); _format.sampleRate = _handle.samplerate(); _format.alFormat = AL_FORMAT_MONO16; - + } LibSoundFile::~LibSoundFile() { - + } void LibSoundFile::seek(unsigned int pos) { - _handle.seek(pos, 0); + _handle.seek(pos, 0); } int LibSoundFile::read(char* buffer, unsigned int size) { - return _handle.readRaw(buffer, size); + return _handle.readRaw(buffer, size); } - + void LibSoundFile::setOutFormat(const PCMFormat& format) { _format = format; switch (_format.alFormat) { - case AL_FORMAT_MONO8: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_S8, 1, _format.sampleRate); - break; - case AL_FORMAT_MONO16: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 1, _format.sampleRate); - break; - case AL_FORMAT_STEREO8: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_S8, 2, _format.sampleRate); - break; - case AL_FORMAT_STEREO16: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 2, _format.sampleRate); - break; - - default: - break; + case AL_FORMAT_MONO8: + _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_S8, 1, _format.sampleRate); + break; + case AL_FORMAT_MONO16: + _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 1, _format.sampleRate); + break; + case AL_FORMAT_STEREO8: + _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_S8, 2, _format.sampleRate); + break; + case AL_FORMAT_STEREO16: + _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 2, _format.sampleRate); + break; + + default: + break; } } |