mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-03 06:41:14 +02:00
Allow AEC with device sample rate up to 96KHz
This commit is contained in:
parent
5c86c22076
commit
bd0849fd4f
2 changed files with 4 additions and 8 deletions
|
@ -1145,12 +1145,10 @@ void AudioClient::processWebrtcFarEnd(const int16_t* samples, int numFrames, int
|
||||||
const webrtc::StreamConfig streamConfig = webrtc::StreamConfig(sampleRate, numChannels);
|
const webrtc::StreamConfig streamConfig = webrtc::StreamConfig(sampleRate, numChannels);
|
||||||
const int numChunk = (int)streamConfig.num_frames();
|
const int numChunk = (int)streamConfig.num_frames();
|
||||||
|
|
||||||
if (sampleRate > webrtc::AudioProcessing::kMaxNativeSampleRateHz) {
|
if (sampleRate > WEBRTC_SAMPLE_RATE_MAX) {
|
||||||
qCWarning(audioclient) << "WebRTC does not support" << sampleRate << "output sample rate.";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (numChannels > WEBRTC_CHANNELS_MAX) {
|
if (numChannels > WEBRTC_CHANNELS_MAX) {
|
||||||
qCWarning(audioclient) << "WebRTC does not support" << numChannels << "output channels.";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1186,16 +1184,13 @@ void AudioClient::processWebrtcNearEnd(int16_t* samples, int numFrames, int numC
|
||||||
const webrtc::StreamConfig streamConfig = webrtc::StreamConfig(sampleRate, numChannels);
|
const webrtc::StreamConfig streamConfig = webrtc::StreamConfig(sampleRate, numChannels);
|
||||||
const int numChunk = (int)streamConfig.num_frames();
|
const int numChunk = (int)streamConfig.num_frames();
|
||||||
|
|
||||||
if (sampleRate > webrtc::AudioProcessing::kMaxNativeSampleRateHz) {
|
if (sampleRate > WEBRTC_SAMPLE_RATE_MAX) {
|
||||||
qCWarning(audioclient) << "WebRTC does not support" << sampleRate << "input sample rate.";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (numChannels > WEBRTC_CHANNELS_MAX) {
|
if (numChannels > WEBRTC_CHANNELS_MAX) {
|
||||||
qCWarning(audioclient) << "WebRTC does not support" << numChannels << "input channels.";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (numFrames != numChunk) {
|
if (numFrames != numChunk) {
|
||||||
qCWarning(audioclient) << "WebRTC requires exactly 10ms of input.";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -423,8 +423,9 @@ private:
|
||||||
void handleLocalEchoAndReverb(QByteArray& inputByteArray);
|
void handleLocalEchoAndReverb(QByteArray& inputByteArray);
|
||||||
|
|
||||||
#if defined(WEBRTC_ENABLED)
|
#if defined(WEBRTC_ENABLED)
|
||||||
static const int WEBRTC_FRAMES_MAX = webrtc::AudioProcessing::kChunkSizeMs * webrtc::AudioProcessing::kMaxNativeSampleRateHz / 1000;
|
static const int WEBRTC_SAMPLE_RATE_MAX = 96000;
|
||||||
static const int WEBRTC_CHANNELS_MAX = 2;
|
static const int WEBRTC_CHANNELS_MAX = 2;
|
||||||
|
static const int WEBRTC_FRAMES_MAX = webrtc::AudioProcessing::kChunkSizeMs * WEBRTC_SAMPLE_RATE_MAX / 1000;
|
||||||
|
|
||||||
webrtc::AudioProcessing* _apm { nullptr };
|
webrtc::AudioProcessing* _apm { nullptr };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue