Add option to AudioFifo to accept any sample size

pull/1344/head
f4exb 2022-06-04 12:27:57 +02:00
rodzic cb09035fa3
commit 63e41e18ef
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -63,6 +63,13 @@ bool AudioFifo::setSize(uint32_t numSamples)
return create(numSamples);
}
bool AudioFifo::setSampleSize(uint32_t sampleSize, uint32_t numSamples)
{
QMutexLocker mutexLocker(&m_mutex);
m_sampleSize = sampleSize;
return create(numSamples);
}
uint32_t AudioFifo::write(const quint8* data, uint32_t numSamples)
{
uint32_t total;

Wyświetl plik

@ -34,6 +34,7 @@ public:
~AudioFifo();
bool setSize(uint32_t numSamples);
bool setSampleSize(uint32_t sampleSize, uint32_t numSamples);
uint32_t write(const quint8* data, uint32_t numSamples);
uint32_t read(quint8* data, uint32_t numSamples);
@ -53,7 +54,7 @@ private:
qint8* m_fifo;
const uint32_t m_sampleSize;
uint32_t m_sampleSize;
uint32_t m_size;
uint32_t m_fill;