mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 05:38:46 -05: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
72c8eccf96
commit
c91b4a1266
@ -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 ())
|
||||
|
@ -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 ();
|
||||
|
Loading…
Reference in New Issue
Block a user