summaryrefslogtreecommitdiffstats
path: root/examples/audiolevels/audiolevels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/audiolevels/audiolevels.cpp')
-rw-r--r--examples/audiolevels/audiolevels.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/audiolevels/audiolevels.cpp b/examples/audiolevels/audiolevels.cpp
index d2038630..e1788936 100644
--- a/examples/audiolevels/audiolevels.cpp
+++ b/examples/audiolevels/audiolevels.cpp
@@ -57,6 +57,12 @@ AudioLevels::AudioLevels(Q3DBars *graph, QObject *parent)
QAudioDeviceInfo inputDevices = QAudioDeviceInfo::defaultInputDevice();
m_audioInput = new QAudioInput(inputDevices, formatAudio, this);
+#ifdef Q_OS_MAC
+ // Mac seems to wait for entire buffer to fill before calling writeData, so use smaller buffer
+ m_audioInput->setBufferSize(256);
+#else
+ m_audioInput->setBufferSize(1024);
+#endif
m_device = new AudioLevelsIODevice(m_graph->activeDataProxy(), this);
m_device->open(QIODevice::WriteOnly);