mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
made RecordingDevice create new SoundData every time captured samples are aquired
--HG-- branch : minor-mic-input
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user