Adding AUDIO application as default for Opus stereo
The Opus audio codec targets applications for pure conversations as well as other types of audio (e.g. music), and there are two different settings to use for this (VoIP and AUDIO). In the current implementation of Opus in WebRTC we use VoIP only. I this CL I have changed default setting to AUDIO in the case of stereo, and kept VoIP as default in case of mono. Next step is to add an API to choose application mode. BUG=issue1239 Review URL: https://webrtc-codereview.appspot.com/1007006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3319 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ad0ed582b5
commit
d0d41498a3
@ -42,8 +42,11 @@ int16_t WebRtcOpus_EncoderCreate(OpusEncInst** inst, int32_t channels) {
|
||||
state = (OpusEncInst*) calloc(1, sizeof(OpusEncInst));
|
||||
if (state) {
|
||||
int error;
|
||||
state->encoder = opus_encoder_create(48000, channels, OPUS_APPLICATION_VOIP,
|
||||
&error);
|
||||
// Default to VoIP application for mono, and AUDIO for stereo.
|
||||
int application = (channels == 1) ?
|
||||
OPUS_APPLICATION_VOIP : OPUS_APPLICATION_AUDIO;
|
||||
|
||||
state->encoder = opus_encoder_create(48000, channels, application, &error);
|
||||
if (error == OPUS_OK || state->encoder != NULL ) {
|
||||
*inst = state;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user