1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(audio): move channel count to audio backend

This commit is contained in:
sudden6 2017-06-05 18:14:14 +02:00
parent 8f2401fee6
commit e1da943e4e
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
3 changed files with 5 additions and 5 deletions

View File

@ -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)
*

View File

@ -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,

View File

@ -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}