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:
Bill Somerville 2017-03-21 15:50:01 +00:00
parent 190f9ca14b
commit 171a226d13
2 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,6 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
format.setSampleType (QAudioFormat::SignedInt);
format.setSampleSize (16);
format.setByteOrder (QAudioFormat::Endian (QSysInfo::ByteOrder));
if (!format.isValid ())
{
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."));
return;
}
qDebug () << "Selected audio input format:" << format;
m_stream.reset (new QAudioInput {device, format});
if (audioError ())

View File

@ -54,7 +54,7 @@ void SoundOutput::setFormat (QAudioDeviceInfo const& device, unsigned channels,
m_msBuffered = msBuffered;
QAudioFormat format (device.preferredFormat ());
qDebug () << "Preferred audio output format:" << format;
format.setChannelCount (channels);
format.setCodec ("audio/pcm");
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."));
}
qDebug () << "Selected audio output format:" << format;
m_stream.reset (new QAudioOutput (device, format));
audioError ();