WebRTC Opus C interface: Add support for non-48 kHz decode sample rate
Plus tests for 16 kHz.
Bug: webrtc:10631
Change-Id: I2d89bc6d0d9548f0ad7bb1e36d6dfde6b6b31f83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138072
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28099}
diff --git a/modules/audio_coding/codecs/opus/opus_interface.h b/modules/audio_coding/codecs/opus/opus_interface.h
index 54ecadd..cf95a69 100644
--- a/modules/audio_coding/codecs/opus/opus_interface.h
+++ b/modules/audio_coding/codecs/opus/opus_interface.h
@@ -328,7 +328,9 @@
*/
int16_t WebRtcOpus_SetForceChannels(OpusEncInst* inst, size_t num_channels);
-int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst, size_t channels);
+int16_t WebRtcOpus_DecoderCreate(OpusDecInst** inst,
+ size_t channels,
+ int sample_rate_hz);
/****************************************************************************
* WebRtcOpus_MultistreamDecoderCreate(...)
@@ -488,13 +490,15 @@
* Input:
* - payload : Encoded data pointer
* - payload_length_bytes : Bytes of encoded data
+ * - sample_rate_hz : Sample rate of output audio
*
* Return value : >0 - The duration of the FEC data in the
* packet in samples per channel.
* 0 - No FEC data in the packet.
*/
int WebRtcOpus_FecDurationEst(const uint8_t* payload,
- size_t payload_length_bytes);
+ size_t payload_length_bytes,
+ int sample_rate_hz);
/****************************************************************************
* WebRtcOpus_PacketHasFec(...)