Skip to content
Permalink
Browse files

Merge PR #2542: Enable the Opus music encoder

  • Loading branch information...
mkrautz committed Sep 4, 2016
2 parents 96d87db + 498e558 commit 2eaed7eba4e179877d420409ad171c80b675469e
Showing with 15 additions and 1 deletion.
  1. +8 −1 src/mumble/AudioInput.cpp
  2. +6 −0 src/mumble/Settings.cpp
  3. +1 −0 src/mumble/Settings.h
@@ -85,7 +85,14 @@ AudioInput::AudioInput() : opusBuffer(g.s.iFramesPerPacket * (SAMPLE_RATE / 100)
iFrameSize = SAMPLE_RATE / 100;

#ifdef USE_OPUS
opusState = opus_encoder_create(SAMPLE_RATE, 1, OPUS_APPLICATION_VOIP, NULL);
if (!g.s.bUseOpusMusicEncoding) {
opusState = opus_encoder_create(SAMPLE_RATE, 1, OPUS_APPLICATION_VOIP, NULL);
qWarning("AudioInput: Opus encoder set for VOIP");
} else {
opusState = opus_encoder_create(SAMPLE_RATE, 1, OPUS_APPLICATION_AUDIO, NULL);
qWarning("AudioInput: Opus encoder set for Music");
}

opus_encoder_ctl(opusState, OPUS_SET_VBR(0)); // CBR
#endif

@@ -249,6 +249,8 @@ Settings::Settings() {
fVADmin = 0.80f;
fVADmax = 0.98f;

bUseOpusMusicEncoding = false;

bTxAudioCue = false;
qsTxAudioCueOn = cqsDefaultPushClickOn;
qsTxAudioCueOff = cqsDefaultPushClickOff;
@@ -590,6 +592,8 @@ void Settings::load(QSettings* settings_ptr) {
SAVELOAD(bWhisperFriends, "audio/whisperfriends");
SAVELOAD(bTransmitPosition, "audio/postransmit");

SAVELOAD(bUseOpusMusicEncoding, "codec/opus/encoder/music");

SAVELOAD(iJitterBufferSize, "net/jitterbuffer");
SAVELOAD(iFramesPerPacket, "net/framesperpacket");

@@ -901,6 +905,8 @@ void Settings::save() {
SAVELOAD(bWhisperFriends, "audio/whisperfriends");
SAVELOAD(bTransmitPosition, "audio/postransmit");

SAVELOAD(bUseOpusMusicEncoding, "codec/opus/encoder/music");

SAVELOAD(iJitterBufferSize, "net/jitterbuffer");
SAVELOAD(iFramesPerPacket, "net/framesperpacket");

@@ -190,6 +190,7 @@ struct Settings {
bool bOnlyAttenuateSameOutput;
bool bAttenuateLoopbacks;
int iOutputDelay;
bool bUseOpusMusicEncoding;

QString qsALSAInput, qsALSAOutput;
QString qsPulseAudioInput, qsPulseAudioOutput;

0 comments on commit 2eaed7e

Please sign in to comment.
You can’t perform that action at this time.