Skip to content

Commit

Permalink
FIX(client, plugins): Wrong sample count in plugin callback
Browse files Browse the repository at this point in the history
In the mumble_onAudioInput callback that plugins can use, the
sampleCount parameter was actually wrong for all cases in which the
input had more than a single channel. Instead of the sample count per
channel, the total sample count (across all channels) was passed along.

Fixes #6464
  • Loading branch information
Krzmbrzl committed Jul 6, 2024
1 parent 325e70e commit e48dd5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mumble/AudioInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,9 @@ void AudioInput::encodeAudioFrame(AudioChunk chunk) {
EncodingOutputBuffer buffer;
Q_ASSERT(buffer.size() >= static_cast< size_t >(iAudioQuality / 100 * iAudioFrames / 8));

emit audioInputEncountered(psSource, iFrameSize, iMicChannels, SAMPLE_RATE, bIsSpeech);
assert(iFrameSize % iMicChannels == 0);
const unsigned int samplesPerChannel = iFrameSize / iMicChannels;
emit audioInputEncountered(psSource, samplesPerChannel, iMicChannels, SAMPLE_RATE, bIsSpeech);

int len = 0;

Expand Down

0 comments on commit e48dd5c

Please sign in to comment.