|
|
@ -43,11 +43,15 @@ void MainWindow::audioStateChanged(QAudio::State state) { |
|
|
|
#endif |
|
|
|
|
|
|
|
void MainWindow::onAudioSample(int16_t left, int16_t right) { |
|
|
|
#ifndef NO_SOUND |
|
|
|
m_audioStream->write(reinterpret_cast<const char*>(left), sizeof(int16_t)); |
|
|
|
m_audioStream->write(reinterpret_cast<const char*>(right), sizeof(int16_t)); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void MainWindow::onAudioSampleBatch(const int16_t *data, size_t frames) { |
|
|
|
#ifndef NO_SOUND |
|
|
|
// each "frame" is two int16_t's (one for each channel of a stereo track)
|
|
|
|
m_audioStream->write(reinterpret_cast<const char*>(data), frames * sizeof(int16_t) * 2); |
|
|
|
#endif |
|
|
|
} |
|
|
|