mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-09 09:24:59 -04:00
Moved audio input to the audio thread.
Change source URLs in teh CMake scripts for the kvasd binaries. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3563 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+5
-5
@@ -38,7 +38,7 @@ bool SoundInput::audioError () const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SoundInput::start(QAudioDeviceInfo const& device, unsigned channels, int framesPerBuffer, QIODevice * sink)
|
||||
void SoundInput::start(QAudioDeviceInfo const& device, unsigned channels, int framesPerBuffer, QIODevice * sink)
|
||||
{
|
||||
Q_ASSERT (0 < channels && channels < 3);
|
||||
Q_ASSERT (sink);
|
||||
@@ -55,26 +55,26 @@ bool SoundInput::start(QAudioDeviceInfo const& device, unsigned channels, int fr
|
||||
if (!format.isValid ())
|
||||
{
|
||||
Q_EMIT error (tr ("Requested input audio format is not valid."));
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
// this function lies!
|
||||
// if (!device.isFormatSupported (format))
|
||||
// {
|
||||
// Q_EMIT error (tr ("Requested input audio format is not supported on device."));
|
||||
// return false;
|
||||
// return;
|
||||
// }
|
||||
|
||||
m_stream.reset (new QAudioInput (device, format, this));
|
||||
if (audioError ())
|
||||
{
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
connect (m_stream.data(), &QAudioInput::stateChanged, this, &SoundInput::handleStateChanged);
|
||||
m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer));
|
||||
m_stream->start (sink);
|
||||
return audioError () ? false : true;
|
||||
audioError ();
|
||||
}
|
||||
|
||||
void SoundInput::handleStateChanged (QAudio::State newState) const
|
||||
|
||||
Reference in New Issue
Block a user