diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index ca9b42f31..1e0681b98 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -59,9 +59,6 @@ * @var Audio::AUDIO_FRAME_SAMPLE_COUNT * @brief Frame sample count * - * @var Audio::AUDIO_CHANNELS - * @brief Ideally, we'd auto-detect, but that's a sane default - * * @fn qreal Audio::outputVolume() const * @brief Returns the current output volume (between 0 and 1) * diff --git a/src/audio/audio.h b/src/audio/audio.h index 2b78b84d4..ca98a7e3c 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -94,13 +94,12 @@ public: virtual void playAudioBuffer(uint sourceId, const int16_t* data, int samples, unsigned channels, int sampleRate) = 0; -public: +protected: // Public default audio settings static constexpr uint32_t AUDIO_SAMPLE_RATE = 48000; static constexpr uint32_t AUDIO_FRAME_DURATION = 20; static constexpr uint32_t AUDIO_FRAME_SAMPLE_COUNT = AUDIO_FRAME_DURATION * AUDIO_SAMPLE_RATE / 1000; - static constexpr uint32_t AUDIO_CHANNELS = 1; signals: void frameAvailable(const int16_t* pcm, size_t sample_count, uint8_t channels, diff --git a/src/audio/backend/openal.cpp b/src/audio/backend/openal.cpp index 324a95619..9da26584a 100644 --- a/src/audio/backend/openal.cpp +++ b/src/audio/backend/openal.cpp @@ -38,9 +38,13 @@ * * @var BUFFER_COUNT * @brief Number of buffers to use per audio source + * + * @var AUDIO_CHANNELS + * @brief Ideally, we'd auto-detect, but that's a sane default */ static const unsigned int BUFFER_COUNT = 16; +static const uint32_t AUDIO_CHANNELS = 2; OpenAL::OpenAL() : audioThread{new QThread}