Renaming SetOpusMaxBandwidth to SetOpusMaxPlaybackRate

This is to maintain the consistency with the Opus codec option "maxplaybackrate" defined in http://tools.ietf.org/html/draft-spittka-payload-rtp-opus-03

BUG=
R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14279004

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@7038 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/modules/audio_coding/codecs/opus/interface/opus_interface.h b/modules/audio_coding/codecs/opus/interface/opus_interface.h
index 3bc7d0e..11c4ac2 100644
--- a/modules/audio_coding/codecs/opus/interface/opus_interface.h
+++ b/modules/audio_coding/codecs/opus/interface/opus_interface.h
@@ -73,25 +73,29 @@
 int16_t WebRtcOpus_SetPacketLossRate(OpusEncInst* inst, int32_t loss_rate);
 
 /****************************************************************************
- * WebRtcOpus_SetMaxBandwidth(...)
+ * WebRtcOpus_SetMaxPlaybackRate(...)
  *
- * Configures the maximum bandwidth for encoding. This can be taken as a hint
- * about the maximum output bandwidth that the receiver is capable to render,
- * due to hardware limitations. Sending signals with higher audio bandwidth
- * results in higher than necessary network usage and encoding complexity.
+ * Configures the maximum playback rate for encoding. Due to hardware
+ * limitations, the receiver may render audio up to a playback rate. Opus
+ * encoder can use this information to optimize for network usage and encoding
+ * complexity. This will affect the audio bandwidth in the coded audio. However,
+ * the input/output sample rate is not affected.
  *
  * Input:
  *      - inst               : Encoder context
- *      - bandwidth          : Maximum encoding bandwidth in Hz.
- *                             This parameter can take any value, but values
- *                             other than Opus typical bandwidths: 4000, 6000,
- *                             8000, 12000, and 20000 will be rounded up (values
- *                             greater than 20000 will be rounded down) to
- *                             these values.
+ *      - frequency_hz       : Maximum playback rate in Hz.
+ *                             This parameter can take any value. The relation
+ *                             between the value and the Opus internal mode is
+ *                             as following:
+ *                             frequency_hz <= 8000           narrow band
+ *                             8000 < frequency_hz <= 12000   medium band
+ *                             12000 < frequency_hz <= 16000  wide band
+ *                             16000 < frequency_hz <= 24000  super wide band
+ *                             frequency_hz > 24000           full band
  * Return value              :  0 - Success
  *                             -1 - Error
  */
-int16_t WebRtcOpus_SetMaxBandwidth(OpusEncInst* inst, int32_t bandwidth);
+int16_t WebRtcOpus_SetMaxPlaybackRate(OpusEncInst* inst, int32_t frequency_hz);
 
 /* TODO(minyue): Check whether an API to check the FEC and the packet loss rate
  * is needed. It might not be very useful since there are not many use cases and
diff --git a/modules/audio_coding/codecs/opus/opus_interface.c b/modules/audio_coding/codecs/opus/opus_interface.c
index 94ad1bd..af581aa 100644
--- a/modules/audio_coding/codecs/opus/opus_interface.c
+++ b/modules/audio_coding/codecs/opus/opus_interface.c
@@ -99,19 +99,19 @@
   }
 }
 
-int16_t WebRtcOpus_SetMaxBandwidth(OpusEncInst* inst, int32_t bandwidth) {
+int16_t WebRtcOpus_SetMaxPlaybackRate(OpusEncInst* inst, int32_t frequency_hz) {
   opus_int32 set_bandwidth;
 
   if (!inst)
     return -1;
 
-  if (bandwidth <= 4000) {
+  if (frequency_hz <= 8000) {
     set_bandwidth = OPUS_BANDWIDTH_NARROWBAND;
-  } else if (bandwidth <= 6000) {
+  } else if (frequency_hz <= 12000) {
     set_bandwidth = OPUS_BANDWIDTH_MEDIUMBAND;
-  } else if (bandwidth <= 8000) {
+  } else if (frequency_hz <= 16000) {
     set_bandwidth = OPUS_BANDWIDTH_WIDEBAND;
-  } else if (bandwidth <= 12000) {
+  } else if (frequency_hz <= 24000) {
     set_bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND;
   } else {
     set_bandwidth = OPUS_BANDWIDTH_FULLBAND;
diff --git a/modules/audio_coding/codecs/opus/opus_unittest.cc b/modules/audio_coding/codecs/opus/opus_unittest.cc
index 582bb73..4a0d49f 100644
--- a/modules/audio_coding/codecs/opus/opus_unittest.cc
+++ b/modules/audio_coding/codecs/opus/opus_unittest.cc
@@ -30,7 +30,7 @@
   OpusTest();
   virtual void SetUp();
 
-  void TestSetMaxBandwidth(opus_int32 expect, int32_t set);
+  void TestSetMaxPlaybackRate(opus_int32 expect, int32_t set);
 
   WebRtcOpusEncInst* opus_mono_encoder_;
   WebRtcOpusEncInst* opus_stereo_encoder_;
@@ -66,15 +66,15 @@
   input_file = NULL;
 }
 
-void OpusTest::TestSetMaxBandwidth(opus_int32 expect, int32_t set) {
+void OpusTest::TestSetMaxPlaybackRate(opus_int32 expect, int32_t set) {
   opus_int32 bandwidth;
   // Test mono encoder.
-  EXPECT_EQ(0, WebRtcOpus_SetMaxBandwidth(opus_mono_encoder_, set));
+  EXPECT_EQ(0, WebRtcOpus_SetMaxPlaybackRate(opus_mono_encoder_, set));
   opus_encoder_ctl(opus_mono_encoder_->encoder,
                    OPUS_GET_MAX_BANDWIDTH(&bandwidth));
   EXPECT_EQ(expect, bandwidth);
   // Test stereo encoder.
-  EXPECT_EQ(0, WebRtcOpus_SetMaxBandwidth(opus_stereo_encoder_, set));
+  EXPECT_EQ(0, WebRtcOpus_SetMaxPlaybackRate(opus_stereo_encoder_, set));
   opus_encoder_ctl(opus_stereo_encoder_->encoder,
                    OPUS_GET_MAX_BANDWIDTH(&bandwidth));
   EXPECT_EQ(expect, bandwidth);
@@ -355,22 +355,25 @@
   EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_stereo_encoder_));
 }
 
-TEST_F(OpusTest, OpusSetMaxBandwidth) {
+TEST_F(OpusTest, OpusSetMaxPlaybackRate) {
   // Test without creating encoder memory.
-  EXPECT_EQ(-1, WebRtcOpus_SetMaxBandwidth(opus_mono_encoder_, 20000));
-  EXPECT_EQ(-1, WebRtcOpus_SetMaxBandwidth(opus_stereo_encoder_, 20000));
+  EXPECT_EQ(-1, WebRtcOpus_SetMaxPlaybackRate(opus_mono_encoder_, 20000));
+  EXPECT_EQ(-1, WebRtcOpus_SetMaxPlaybackRate(opus_stereo_encoder_, 20000));
 
   // Create encoder memory, try with different bitrates.
   EXPECT_EQ(0, WebRtcOpus_EncoderCreate(&opus_mono_encoder_, 1));
   EXPECT_EQ(0, WebRtcOpus_EncoderCreate(&opus_stereo_encoder_, 2));
 
-  TestSetMaxBandwidth(OPUS_BANDWIDTH_FULLBAND, 24000);
-  TestSetMaxBandwidth(OPUS_BANDWIDTH_FULLBAND, 14000);
-  TestSetMaxBandwidth(OPUS_BANDWIDTH_SUPERWIDEBAND, 10000);
-  TestSetMaxBandwidth(OPUS_BANDWIDTH_WIDEBAND, 7000);
-  TestSetMaxBandwidth(OPUS_BANDWIDTH_MEDIUMBAND, 6000);
-  TestSetMaxBandwidth(OPUS_BANDWIDTH_NARROWBAND, 4000);
-  TestSetMaxBandwidth(OPUS_BANDWIDTH_NARROWBAND, 3000);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_FULLBAND, 48000);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_FULLBAND, 24001);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_SUPERWIDEBAND, 24000);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_SUPERWIDEBAND, 16001);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_WIDEBAND, 16000);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_WIDEBAND, 12001);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_MEDIUMBAND, 12000);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_MEDIUMBAND, 8001);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_NARROWBAND, 8000);
+  TestSetMaxPlaybackRate(OPUS_BANDWIDTH_NARROWBAND, 4000);
 
   // Free memory.
   EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_mono_encoder_));
diff --git a/modules/audio_coding/main/acm2/acm_generic_codec.cc b/modules/audio_coding/main/acm2/acm_generic_codec.cc
index 565d291..361de30 100644
--- a/modules/audio_coding/main/acm2/acm_generic_codec.cc
+++ b/modules/audio_coding/main/acm2/acm_generic_codec.cc
@@ -1000,9 +1000,9 @@
   return -1;
 }
 
-int ACMGenericCodec::SetOpusMaxBandwidth(int /* max_bandwidth */) {
+int ACMGenericCodec::SetOpusMaxPlaybackRate(int /* frequency_hz */) {
   WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceAudioCoding, unique_id_,
-               "The send-codec is not Opus, failed to set maximum bandwidth.");
+      "The send-codec is not Opus, failed to set maximum playback rate.");
   return -1;
 }
 
diff --git a/modules/audio_coding/main/acm2/acm_generic_codec.h b/modules/audio_coding/main/acm2/acm_generic_codec.h
index b88e28f..f4ee5e5 100644
--- a/modules/audio_coding/main/acm2/acm_generic_codec.h
+++ b/modules/audio_coding/main/acm2/acm_generic_codec.h
@@ -538,21 +538,20 @@
                                  int16_t* payload_len_bytes);
 
   ///////////////////////////////////////////////////////////////////////////
-  // int SetOpusMaxBandwidth()
-  // Sets maximum required encoding bandwidth for Opus. This is to tell Opus
-  // that it is enough to code the input audio up to a bandwidth. A use case of
-  // this is when the receiver cannot render the full band. Opus can take this
-  // information to optimize the bit rate and increase the computation
-  // efficiency.
+  // int SetOpusMaxPlaybackRate()
+  // Sets maximum playback rate the receiver will render, if the codec is Opus.
+  // This is to tell Opus that it is enough to code the input audio up to a
+  // bandwidth. Opus can take this information to optimize the bit rate and
+  // increase the computation efficiency.
   //
   // Input:
-  //   -max_bandwidth      : maximum required bandwidth.
+  //   -frequency_hz      : maximum playback rate in Hz.
   //
   // Return value:
   //   -1 if failed or on codecs other than Opus
   //    0 if succeeded.
   //
-  virtual int SetOpusMaxBandwidth(int /* max_bandwidth */);
+  virtual int SetOpusMaxPlaybackRate(int /* frequency_hz */);
 
   ///////////////////////////////////////////////////////////////////////////
   // HasFrameToEncode()
diff --git a/modules/audio_coding/main/acm2/acm_opus.cc b/modules/audio_coding/main/acm2/acm_opus.cc
index e005434..2a3a573 100644
--- a/modules/audio_coding/main/acm2/acm_opus.cc
+++ b/modules/audio_coding/main/acm2/acm_opus.cc
@@ -263,9 +263,9 @@
   return -1;
 }
 
-int ACMOpus::SetOpusMaxBandwidth(int max_bandwidth) {
-  // Ask the encoder to change the maximum required bandwidth.
-  return WebRtcOpus_SetMaxBandwidth(encoder_inst_ptr_, max_bandwidth);
+int ACMOpus::SetOpusMaxPlaybackRate(int frequency_hz) {
+  // Informs Opus encoder of the maximum playback rate the receiver will render.
+  return WebRtcOpus_SetMaxPlaybackRate(encoder_inst_ptr_, frequency_hz);
 }
 
 #endif  // WEBRTC_CODEC_OPUS
diff --git a/modules/audio_coding/main/acm2/acm_opus.h b/modules/audio_coding/main/acm2/acm_opus.h
index 8c2882c..7fefbd7 100644
--- a/modules/audio_coding/main/acm2/acm_opus.h
+++ b/modules/audio_coding/main/acm2/acm_opus.h
@@ -38,7 +38,7 @@
 
   virtual int SetPacketLossRate(int loss_rate) OVERRIDE;
 
-  virtual int SetOpusMaxBandwidth(int max_bandwidth) OVERRIDE;
+  virtual int SetOpusMaxPlaybackRate(int frequency_hz) OVERRIDE;
 
  protected:
   void DestructEncoderSafe();
diff --git a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index 164c0bb..381f020 100644
--- a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -1911,13 +1911,13 @@
       frame_size_ms, rate_bit_per_sec, enforce_frame_size);
 }
 
-// Informs Opus encoder about the maximum audio bandwidth needs to be encoded.
-int AudioCodingModuleImpl::SetOpusMaxBandwidth(int bandwidth_hz) {
+// Informs Opus encoder of the maximum playback rate the receiver will render.
+int AudioCodingModuleImpl::SetOpusMaxPlaybackRate(int frequency_hz) {
   CriticalSectionScoped lock(acm_crit_sect_);
-  if (!HaveValidEncoder("SetOpusMaxBandwidth")) {
+  if (!HaveValidEncoder("SetOpusMaxPlaybackRate")) {
     return -1;
   }
-  return codecs_[current_send_codec_idx_]->SetOpusMaxBandwidth(bandwidth_hz);
+  return codecs_[current_send_codec_idx_]->SetOpusMaxPlaybackRate(frequency_hz);
 }
 
 int AudioCodingModuleImpl::PlayoutTimestamp(uint32_t* timestamp) {
diff --git a/modules/audio_coding/main/acm2/audio_coding_module_impl.h b/modules/audio_coding/main/acm2/audio_coding_module_impl.h
index 9e5cc37..635b4dc 100644
--- a/modules/audio_coding/main/acm2/audio_coding_module_impl.h
+++ b/modules/audio_coding/main/acm2/audio_coding_module_impl.h
@@ -232,9 +232,9 @@
                                    int rate_bit_per_sec,
                                    bool enforce_frame_size = false);
 
-  // If current send codec is Opus, informs it about the maximum audio
-  // bandwidth needs to be encoded.
-  int SetOpusMaxBandwidth(int bandwidth_hz);
+  // If current send codec is Opus, informs it about the maximum playback rate
+  // the receiver will render.
+  int SetOpusMaxPlaybackRate(int frequency_hz);
 
   int UnregisterReceiveCodec(uint8_t payload_type);
 
diff --git a/modules/audio_coding/main/interface/audio_coding_module.h b/modules/audio_coding/main/interface/audio_coding_module.h
index aae7ead..fef4f9b 100644
--- a/modules/audio_coding/main/interface/audio_coding_module.h
+++ b/modules/audio_coding/main/interface/audio_coding_module.h
@@ -916,21 +916,20 @@
       bool enforce_frame_size = false) = 0;
 
   ///////////////////////////////////////////////////////////////////////////
-  // int SetOpusMaxBandwidth()
-  // If current send codec is Opus, informs it about maximum audio bandwidth
-  // needs to be encoded. A use case of this is when the receiver can only play
-  // audio up to frequency limit. Opus can use this information to optimize
-  // the bit rate and increase the computation efficiency.
+  // int SetOpusMaxPlaybackRate()
+  // If current send codec is Opus, informs it about maximum playback rate the
+  // receiver will render. Opus can use this information to optimize the bit
+  // rate and increase the computation efficiency.
   //
   // Input:
-  //   -banbwidth_hz            : maximum bandwidth in Hz.
+  //   -frequency_hz            : maximum playback rate in Hz.
   //
   // Return value:
   //   -1 if current send codec is not Opus or
-  //      error occurred in setting the bandwidth,
+  //      error occurred in setting the maximum playback rate,
   //    0 maximum bandwidth is set successfully.
   //
-  virtual int SetOpusMaxBandwidth(int banbwidth_hz) = 0;
+  virtual int SetOpusMaxPlaybackRate(int frequency_hz) = 0;
 
   ///////////////////////////////////////////////////////////////////////////
   //   statistics
diff --git a/voice_engine/channel.cc b/voice_engine/channel.cc
index 73d6be9..41728c7 100644
--- a/voice_engine/channel.cc
+++ b/voice_engine/channel.cc
@@ -1751,14 +1751,14 @@
     return 0;
 }
 
-int Channel::SetOpusMaxBandwidth(int bandwidth_hz) {
+int Channel::SetOpusMaxPlaybackRate(int frequency_hz) {
   WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
-               "Channel::SetOpusMaxBandwidth()");
+               "Channel::SetOpusMaxPlaybackRate()");
 
-  if (audio_coding_->SetOpusMaxBandwidth(bandwidth_hz) != 0) {
+  if (audio_coding_->SetOpusMaxPlaybackRate(frequency_hz) != 0) {
     _engineStatisticsPtr->SetLastError(
         VE_AUDIO_CODING_MODULE_ERROR, kTraceError,
-        "SetOpusMaxBandwidth() failed to set maximum encoding bandwidth");
+        "SetOpusMaxPlaybackRate() failed to set maximum playback rate");
     return -1;
   }
   return 0;
diff --git a/voice_engine/channel.h b/voice_engine/channel.h
index c1f6ed2..94fa04f 100644
--- a/voice_engine/channel.h
+++ b/voice_engine/channel.h
@@ -208,7 +208,7 @@
     int32_t SetRecPayloadType(const CodecInst& codec);
     int32_t GetRecPayloadType(CodecInst& codec);
     int32_t SetSendCNPayloadType(int type, PayloadFrequencies frequency);
-    int SetOpusMaxBandwidth(int bandwidth_hz);
+    int SetOpusMaxPlaybackRate(int frequency_hz);
 
     // VoE dual-streaming.
     int SetSecondarySendCodec(const CodecInst& codec, int red_payload_type);
diff --git a/voice_engine/include/voe_codec.h b/voice_engine/include/voe_codec.h
index 56835f7..234596a 100644
--- a/voice_engine/include/voe_codec.h
+++ b/voice_engine/include/voe_codec.h
@@ -126,11 +126,11 @@
     virtual int GetVADStatus(int channel, bool& enabled, VadModes& mode,
                              bool& disabledDTX) = 0;
 
-    // Sets the maximum audio bandwidth needs to be encoded in Hz,
-    // |bandwidth_hz|, for the Opus encoder on a specific |channel|.
-    // TODO(minyue): Make SetOpusMaxBandwidth() pure virtual when
+    // If send codec is Opus on a specified |channel|, sets the maximum playback
+    // rate the receiver will render: |frequency_hz| (in Hz).
+    // TODO(minyue): Make SetOpusMaxPlaybackRate() pure virtual when
     // fakewebrtcvoiceengine in talk is ready.
-    virtual int SetOpusMaxBandwidth(int channel, int bandwidth_hz) {
+    virtual int SetOpusMaxPlaybackRate(int channel, int frequency_hz) {
       return -1;
     }
 
diff --git a/voice_engine/test/auto_test/standard/codec_test.cc b/voice_engine/test/auto_test/standard/codec_test.cc
index 8ca4328..3b56bae 100644
--- a/voice_engine/test/auto_test/standard/codec_test.cc
+++ b/voice_engine/test/auto_test/standard/codec_test.cc
@@ -130,30 +130,30 @@
   EXPECT_EQ(webrtc::kVadConventional, vad_mode);
 }
 
-TEST_F(CodecTest, OpusMaxBandwidthCanBeSet) {
+TEST_F(CodecTest, OpusMaxPlaybackRateCanBeSet) {
   for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) {
     voe_codec_->GetCodec(i, codec_instance_);
     if (_stricmp("opus", codec_instance_.plname)) {
       continue;
     }
     voe_codec_->SetSendCodec(channel_, codec_instance_);
-    // SetOpusMaxBandwidth can handle any integer as the bandwidth. Following
+    // SetOpusMaxPlaybackRate can handle any integer as the bandwidth. Following
     // tests some most commonly used numbers.
-    EXPECT_EQ(0, voe_codec_->SetOpusMaxBandwidth(channel_, 24000));
-    EXPECT_EQ(0, voe_codec_->SetOpusMaxBandwidth(channel_, 16000));
-    EXPECT_EQ(0, voe_codec_->SetOpusMaxBandwidth(channel_, 8000));
-    EXPECT_EQ(0, voe_codec_->SetOpusMaxBandwidth(channel_, 4000));
+    EXPECT_EQ(0, voe_codec_->SetOpusMaxPlaybackRate(channel_, 48000));
+    EXPECT_EQ(0, voe_codec_->SetOpusMaxPlaybackRate(channel_, 32000));
+    EXPECT_EQ(0, voe_codec_->SetOpusMaxPlaybackRate(channel_, 16000));
+    EXPECT_EQ(0, voe_codec_->SetOpusMaxPlaybackRate(channel_, 8000));
   }
 }
 
-TEST_F(CodecTest, OpusMaxBandwidthCannotBeSetForNonOpus) {
+TEST_F(CodecTest, OpusMaxPlaybackRateCannotBeSetForNonOpus) {
   for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) {
     voe_codec_->GetCodec(i, codec_instance_);
     if (!_stricmp("opus", codec_instance_.plname)) {
       continue;
     }
     voe_codec_->SetSendCodec(channel_, codec_instance_);
-    EXPECT_EQ(-1, voe_codec_->SetOpusMaxBandwidth(channel_, 16000));
+    EXPECT_EQ(-1, voe_codec_->SetOpusMaxPlaybackRate(channel_, 16000));
   }
 }
 
diff --git a/voice_engine/test/cmd_test/voe_cmd_test.cc b/voice_engine/test/cmd_test/voe_cmd_test.cc
index b5d2dca..09a70a9 100644
--- a/voice_engine/test/cmd_test/voe_cmd_test.cc
+++ b/voice_engine/test/cmd_test/voe_cmd_test.cc
@@ -445,7 +445,7 @@
       printf("%i. Remove a file-playing channel \n", option_index++);
       printf("%i. Toggle Opus stereo (Opus must be selected again to apply "
              "the setting) \n", option_index++);
-      printf("%i. Set Opus maximum audio bandwidth \n", option_index++);
+      printf("%i. Set Opus maximum playback rate \n", option_index++);
       printf("%i. Set bit rate (only take effect on codecs that allow the "
              "change) \n", option_index++);
 
@@ -761,10 +761,10 @@
           printf("\n Opus mono enabled (select Opus again to apply the "
                  "setting). \n");
       } else if (option_selection == option_index++) {
-        printf("\n Input bandwidth in Hz: ");
+        printf("\n Input maxium playback rate in Hz: ");
         int max_playback_rate;
         ASSERT_EQ(1, scanf("%i", &max_playback_rate));
-        res = codec->SetOpusMaxBandwidth(chan, max_playback_rate);
+        res = codec->SetOpusMaxPlaybackRate(chan, max_playback_rate);
         VALIDATE;
       } else if (option_selection == option_index++) {
         res = codec->GetSendCodec(chan, cinst);
diff --git a/voice_engine/voe_codec_impl.cc b/voice_engine/voe_codec_impl.cc
index 5099407..6f470be 100644
--- a/voice_engine/voe_codec_impl.cc
+++ b/voice_engine/voe_codec_impl.cc
@@ -418,10 +418,10 @@
     return 0;
 }
 
-int VoECodecImpl::SetOpusMaxBandwidth(int channel, int bandwidth_hz) {
+int VoECodecImpl::SetOpusMaxPlaybackRate(int channel, int frequency_hz) {
   WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
-               "SetOpusMaxBandwidth(channel=%d, bandwidth_hz=%d)", channel,
-               bandwidth_hz);
+               "SetOpusMaxPlaybackRate(channel=%d, frequency_hz=%d)", channel,
+               frequency_hz);
   if (!_shared->statistics().Initialized()) {
     _shared->SetLastError(VE_NOT_INITED, kTraceError);
     return -1;
@@ -430,10 +430,10 @@
   voe::Channel* channelPtr = ch.channel();
   if (channelPtr == NULL) {
     _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
-                          "SetOpusMaxBandwidth failed to locate channel");
+                          "SetOpusMaxPlaybackRate failed to locate channel");
     return -1;
   }
-  return channelPtr->SetOpusMaxBandwidth(bandwidth_hz);
+  return channelPtr->SetOpusMaxPlaybackRate(frequency_hz);
 }
 
 void VoECodecImpl::ACMToExternalCodecRepresentation(CodecInst& toInst,
diff --git a/voice_engine/voe_codec_impl.h b/voice_engine/voe_codec_impl.h
index 498854d..f001df8 100644
--- a/voice_engine/voe_codec_impl.h
+++ b/voice_engine/voe_codec_impl.h
@@ -54,7 +54,7 @@
                              VadModes& mode,
                              bool& disabledDTX);
 
-    virtual int SetOpusMaxBandwidth(int channel, int bandwidth_hz);
+    virtual int SetOpusMaxPlaybackRate(int channel, int frequency_hz);
 
     // Dual-streaming
     virtual int SetSecondarySendCodec(int channel, const CodecInst& codec,