kopia lustrzana https://gitlab.com/eliggett/wfview
When using Float, force 32bit as Mac doesn't like it otherwise
rodzic
3aefa68939
commit
85ba0fb569
|
@ -126,6 +126,17 @@ bool audioHandler::init(audioSetup setupIn)
|
|||
}
|
||||
}
|
||||
|
||||
if (format.sampleType()==QAudioFormat::SignedInt) {
|
||||
format.setSampleType(QAudioFormat::Float);
|
||||
format.setSampleSize(32);
|
||||
if (!setup.port.isFormatSupported(format)) {
|
||||
qCritical(logAudio()) << (setup.isinput ? "Input" : "Output") << "Attempt to select 32bit Float failed, reverting to SignedInt";
|
||||
format.setSampleType(QAudioFormat::SignedInt);
|
||||
format.setSampleSize(16);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (format.sampleSize() == 24) {
|
||||
// We can't convert this easily so use 32 bit instead.
|
||||
format.setSampleSize(32);
|
||||
|
@ -134,11 +145,6 @@ bool audioHandler::init(audioSetup setupIn)
|
|||
format.setSampleSize(16);
|
||||
}
|
||||
}
|
||||
format.setSampleType(QAudioFormat::Float);
|
||||
if (!setup.port.isFormatSupported(format)) {
|
||||
qCritical(logAudio()) << (setup.isinput ? "Input" : "Output") << "Attempt to select Float failed, reverting to SignedInt";
|
||||
format.setSampleType(QAudioFormat::SignedInt);
|
||||
}
|
||||
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Selected format: SampleSize" << format.sampleSize() << "Channel Count" << format.channelCount() <<
|
||||
"Sample Rate" << format.sampleRate() << "Codec" << format.codec() << "Sample Type" << format.sampleType();
|
||||
|
@ -695,4 +701,4 @@ void audioHandler::stateChanged(QAudio::State state)
|
|||
void audioHandler::clearUnderrun()
|
||||
{
|
||||
isUnderrun = false;
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue