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:
parent
8f2401fee6
commit
e1da943e4e
|
@ -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)
|
||||
*
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue
Block a user