From ff04a9310be11240d01eee6c94b65864f7da0736 Mon Sep 17 00:00:00 2001 From: Gilles Schintgen Date: Sat, 11 May 2024 13:49:49 +0200 Subject: [PATCH] Logging/Opus: add basic stream info at loglevel 'info' Previously no information at all was logged about the used codec. --- src/audio.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/audio.cpp b/src/audio.cpp index 1995e380ea7..f55046c078c 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -115,6 +115,10 @@ namespace audio { opus_multistream_encoder_ctl(opus.get(), OPUS_SET_BITRATE(stream->bitrate)); opus_multistream_encoder_ctl(opus.get(), OPUS_SET_VBR(0)); + BOOST_LOG(info) << "Opus initialized: "sv << stream->sampleRate / 1000 << " kHz, "sv + << stream->channelCount << " channels, "sv + << stream->bitrate / 1000 << " kbps (total), LOWDELAY"sv; + auto frame_size = config.packetDuration * stream->sampleRate / 1000; while (auto sample = samples->pop()) { buffer_t packet { 1400 };