diff options
Diffstat (limited to 'source/SoundTouch/SoundTouch.cpp')
-rw-r--r-- | source/SoundTouch/SoundTouch.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/SoundTouch/SoundTouch.cpp b/source/SoundTouch/SoundTouch.cpp index 79ce263..cd7693b 100644 --- a/source/SoundTouch/SoundTouch.cpp +++ b/source/SoundTouch/SoundTouch.cpp @@ -143,10 +143,11 @@ uint SoundTouch::getVersionId() // Sets the number of channels, 1 = mono, 2 = stereo
void SoundTouch::setChannels(uint numChannels)
{
- if (numChannels != 1 && numChannels != 2)
+ /*if (numChannels != 1 && numChannels != 2)
{
- ST_THROW_RT_ERROR("Illegal number of channels");
- }
+ //ST_THROW_RT_ERROR("Illegal number of channels");
+ return;
+ }*/
channels = numChannels;
pRateTransposer->setChannels((int)numChannels);
pTDStretch->setChannels((int)numChannels);
@@ -347,7 +348,7 @@ void SoundTouch::flush() int i;
int nUnprocessed;
int nOut;
- SAMPLETYPE buff[64*2]; // note: allocate 2*64 to cater 64 sample frames of stereo sound
+ SAMPLETYPE *buff=(SAMPLETYPE*)alloca(64*channels*sizeof(SAMPLETYPE));
// check how many samples still await processing, and scale
// that by tempo & rate to get expected output sample count
|