mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 22:39:18 +02:00
Cleanup the confusion of using null-resampler for channel conversion
This commit is contained in:
parent
c555e369c8
commit
96313a421c
1 changed files with 5 additions and 6 deletions
|
@ -823,15 +823,14 @@ void AudioClient::handleLocalEchoAndReverb(QByteArray& inputByteArray) {
|
||||||
int16_t* inputSamples = reinterpret_cast<int16_t*>(inputByteArray.data());
|
int16_t* inputSamples = reinterpret_cast<int16_t*>(inputByteArray.data());
|
||||||
int16_t* loopbackSamples = reinterpret_cast<int16_t*>(loopBackByteArray.data());
|
int16_t* loopbackSamples = reinterpret_cast<int16_t*>(loopBackByteArray.data());
|
||||||
|
|
||||||
auto NO_RESAMPLER = nullptr;
|
// upmix mono to stereo
|
||||||
possibleResampling(NO_RESAMPLER,
|
if (!sampleChannelConversion(inputSamples, loopbackSamples, numInputSamples, _inputFormat, _outputFormat)) {
|
||||||
inputSamples, loopbackSamples,
|
// no conversion, just copy the samples
|
||||||
numInputSamples, numLoopbackSamples,
|
memcpy(loopbackSamples, inputSamples, numInputSamples * sizeof(int16_t));
|
||||||
_inputFormat, _outputFormat);
|
}
|
||||||
|
|
||||||
// apply stereo reverb at the source, to the loopback audio
|
// apply stereo reverb at the source, to the loopback audio
|
||||||
if (!_shouldEchoLocally && hasReverb) {
|
if (!_shouldEchoLocally && hasReverb) {
|
||||||
assert(_outputFormat.channelCount() == 2);
|
|
||||||
updateReverbOptions();
|
updateReverbOptions();
|
||||||
_sourceReverb.render(loopbackSamples, loopbackSamples, numLoopbackSamples/2);
|
_sourceReverb.render(loopbackSamples, loopbackSamples, numLoopbackSamples/2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue