mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 21:58:38 -05:00
Only tune audio buffer sizes on Windows
This commit is contained in:
parent
0cf14dfcc9
commit
4f68dfda40
@ -82,7 +82,11 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
|
|||||||
//qDebug () << "SoundIn default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize ();
|
//qDebug () << "SoundIn default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize ();
|
||||||
// the Windows MME version of QAudioInput uses 1/5 of the buffer
|
// the Windows MME version of QAudioInput uses 1/5 of the buffer
|
||||||
// size for period size other platforms seem to optimize themselves
|
// size for period size other platforms seem to optimize themselves
|
||||||
|
#if defined (Q_OS_WIN)
|
||||||
m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer * 5));
|
m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer * 5));
|
||||||
|
#else
|
||||||
|
Q_UNUSED (framesPerBuffer);
|
||||||
|
#endif
|
||||||
if (sink->initialize (QIODevice::WriteOnly, channel))
|
if (sink->initialize (QIODevice::WriteOnly, channel))
|
||||||
{
|
{
|
||||||
m_stream->start (sink);
|
m_stream->start (sink);
|
||||||
|
@ -85,7 +85,9 @@ void SoundOutput::restart (QIODevice * source)
|
|||||||
//qDebug () << "SoundOut default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize ();
|
//qDebug () << "SoundOut default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize ();
|
||||||
if (m_framesBuffered)
|
if (m_framesBuffered)
|
||||||
{
|
{
|
||||||
|
#if defined (Q_OS_WIN)
|
||||||
m_stream->setBufferSize (m_stream->format().bytesForFrames (m_framesBuffered));
|
m_stream->setBufferSize (m_stream->format().bytesForFrames (m_framesBuffered));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
m_stream->setCategory ("production");
|
m_stream->setCategory ("production");
|
||||||
m_stream->start (source);
|
m_stream->start (source);
|
||||||
|
Loading…
Reference in New Issue
Block a user