made RecordingDevice create new SoundData every time captured samples are aquired

--HG--
branch : minor-mic-input
This commit is contained in:
Raidho
2016-10-23 18:53:02 +03:00
parent 87f0b2811e
commit 9a090e8df8
2 changed files with 8 additions and 35 deletions
+3 -2
View File
@@ -102,8 +102,9 @@ int RecordingDevice::getData(love::sound::SoundData *soundData)
if (samples == 0)
return 0;
//resize internal buffer to proper size
if (samples != soundData->getSampleCount())
//reinitialize soundData if necessary
if (samples != soundData->getSampleCount() || sampleRate != soundData->getSampleRate() ||
bitDepth != soundData->getBitDepth() || channels != soundData->getChannels())
soundData->load(samples, sampleRate, bitDepth, channels);
alcCaptureSamples(device, soundData->getData(), samples);