mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:43:45 +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;
|
QByteArray outputAudioByteArray;
|
||||||
|
|
||||||
int sampleRate = interpretAsWav(rawAudioByteArray, outputAudioByteArray);
|
int sampleRate = interpretAsWav(rawAudioByteArray, outputAudioByteArray);
|
||||||
if (sampleRate != 0) {
|
if (sampleRate == 0) {
|
||||||
downSample(outputAudioByteArray, sampleRate);
|
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)) {
|
} else if (fileName.endsWith(RAW_EXTENSION)) {
|
||||||
// check if this was a stereo raw file
|
// 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
|
// 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