From c91b4a1266cf6f9e9697b88f8e25f56142439447 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 21 Mar 2017 15:50:01 +0000 Subject: [PATCH] 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 --- soundin.cpp | 2 +- soundout.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/soundin.cpp b/soundin.cpp index 0df8bc287..eaa30b8e8 100644 --- a/soundin.cpp +++ b/soundin.cpp @@ -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 ()) diff --git a/soundout.cpp b/soundout.cpp index de89f17bd..4295c2560 100644 --- a/soundout.cpp +++ b/soundout.cpp @@ -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 ();