mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-10-31 23:57:10 -04:00
Less confusing audio format diagnostics
Show device preferred and actually selected formats for both input and output. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7615 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
190f9ca14b
commit
171a226d13
@ -57,7 +57,6 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
|
|||||||
format.setSampleType (QAudioFormat::SignedInt);
|
format.setSampleType (QAudioFormat::SignedInt);
|
||||||
format.setSampleSize (16);
|
format.setSampleSize (16);
|
||||||
format.setByteOrder (QAudioFormat::Endian (QSysInfo::ByteOrder));
|
format.setByteOrder (QAudioFormat::Endian (QSysInfo::ByteOrder));
|
||||||
|
|
||||||
if (!format.isValid ())
|
if (!format.isValid ())
|
||||||
{
|
{
|
||||||
Q_EMIT error (tr ("Requested input audio format is not valid."));
|
Q_EMIT error (tr ("Requested input audio format is not valid."));
|
||||||
@ -70,6 +69,7 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
|
|||||||
Q_EMIT error (tr ("Requested input audio format is not supported on device."));
|
Q_EMIT error (tr ("Requested input audio format is not supported on device."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
qDebug () << "Selected audio input format:" << format;
|
||||||
|
|
||||||
m_stream.reset (new QAudioInput {device, format});
|
m_stream.reset (new QAudioInput {device, format});
|
||||||
if (audioError ())
|
if (audioError ())
|
||||||
|
@ -54,7 +54,7 @@ void SoundOutput::setFormat (QAudioDeviceInfo const& device, unsigned channels,
|
|||||||
m_msBuffered = msBuffered;
|
m_msBuffered = msBuffered;
|
||||||
|
|
||||||
QAudioFormat format (device.preferredFormat ());
|
QAudioFormat format (device.preferredFormat ());
|
||||||
|
qDebug () << "Preferred audio output format:" << format;
|
||||||
format.setChannelCount (channels);
|
format.setChannelCount (channels);
|
||||||
format.setCodec ("audio/pcm");
|
format.setCodec ("audio/pcm");
|
||||||
format.setSampleRate (48000);
|
format.setSampleRate (48000);
|
||||||
@ -69,6 +69,7 @@ void SoundOutput::setFormat (QAudioDeviceInfo const& device, unsigned channels,
|
|||||||
{
|
{
|
||||||
Q_EMIT error (tr ("Requested output audio format is not supported on device."));
|
Q_EMIT error (tr ("Requested output audio format is not supported on device."));
|
||||||
}
|
}
|
||||||
|
qDebug () << "Selected audio output format:" << format;
|
||||||
|
|
||||||
m_stream.reset (new QAudioOutput (device, format));
|
m_stream.reset (new QAudioOutput (device, format));
|
||||||
audioError ();
|
audioError ();
|
||||||
|
Loading…
Reference in New Issue
Block a user