Skip to content

Commit

Permalink
Use supported opus encoder rate
Browse files Browse the repository at this point in the history
  • Loading branch information
daid committed Apr 29, 2024
1 parent 19f0827 commit d623512
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/networkAudioStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NetworkAudioStream::NetworkAudioStream()
samples.reserve(sample_rate * 10);

int error = 0;
decoder = opus_decoder_create(sample_rate, 1, &error);
decoder = opus_decoder_create(48000, 1, &error);
}

void NetworkAudioStream::onMixSamples(int16_t* stream, int sample_count)
Expand Down
2 changes: 1 addition & 1 deletion src/networkRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void NetworkAudioRecorder::update(float /*delta*/)
void NetworkAudioRecorder::startSending()
{
int error = 0;
encoder = opus_encoder_create(44100, 1, OPUS_APPLICATION_VOIP, &error);
encoder = opus_encoder_create(48000, 1, OPUS_APPLICATION_VOIP, &error);
if (!encoder)
{
LOG(ERROR) << "Failed to create opus encoder:" << error;
Expand Down

0 comments on commit d623512

Please sign in to comment.