mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 20:07:07 +02:00
Invalid WAV files should always be logged and not played
This commit is contained in:
parent
a75010fb94
commit
b6a88bbdda
1 changed files with 6 additions and 2 deletions
|
@ -96,9 +96,13 @@ void SoundProcessor::run() {
|
|||
QByteArray outputAudioByteArray;
|
||||
|
||||
int sampleRate = interpretAsWav(rawAudioByteArray, outputAudioByteArray);
|
||||
if (sampleRate != 0) {
|
||||
downSample(outputAudioByteArray, sampleRate);
|
||||
if (sampleRate == 0) {
|
||||
qCDebug(audio) << "Unsupported WAV file type";
|
||||
emit onError(300, "Failed to load sound file, reason: unsupported WAV file type");
|
||||
return;
|
||||
}
|
||||
|
||||
downSample(outputAudioByteArray, sampleRate);
|
||||
} else if (fileName.endsWith(RAW_EXTENSION)) {
|
||||
// check if this was a stereo raw file
|
||||
// since it's raw the only way for us to know that is if the file was called .stereo.raw
|
||||
|
|
Loading…
Reference in a new issue