mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 06:19:49 +02:00
Fix nasty preexisting bug in computing numSamples, where sizeof(SAMPLE_SIZE) incorrectly returns 4 instead of 2.
This commit is contained in:
parent
71de3d5ca1
commit
986d86ec17
2 changed files with 2 additions and 2 deletions
|
@ -1007,7 +1007,7 @@ void AudioClient::handleAudioInput(QByteArray& audioBuffer) {
|
|||
_timeSinceLastClip = 0.0f;
|
||||
} else {
|
||||
int16_t* samples = reinterpret_cast<int16_t*>(audioBuffer.data());
|
||||
int numSamples = audioBuffer.size() / sizeof(AudioConstants::SAMPLE_SIZE);
|
||||
int numSamples = audioBuffer.size() / AudioConstants::SAMPLE_SIZE;
|
||||
bool didClip = false;
|
||||
|
||||
bool shouldRemoveDCOffset = !_isPlayingBackRecording && !_isStereoInput;
|
||||
|
|
|
@ -139,7 +139,7 @@ bool AudioInjector::inject(bool(AudioInjectorManager::*injection)(AudioInjector*
|
|||
if (_options.secondOffset > 0.0f) {
|
||||
int numChannels = _options.ambisonic ? 4 : (_options.stereo ? 2 : 1);
|
||||
byteOffset = (int)(AudioConstants::SAMPLE_RATE * _options.secondOffset * numChannels);
|
||||
byteOffset *= sizeof(AudioConstants::SAMPLE_SIZE);
|
||||
byteOffset *= AudioConstants::SAMPLE_SIZE;
|
||||
}
|
||||
_currentSendOffset = byteOffset;
|
||||
|
||||
|
|
Loading…
Reference in a new issue