assume RAW audio if not processed as WAV

This commit is contained in:
Philip Rosedale 2014-02-25 13:21:02 -08:00
parent 11e9b18a98
commit 70c1f8290e

View file

@ -44,13 +44,8 @@ void Sound::replyFinished(QNetworkReply* reply) {
QByteArray headerContentType = reply->rawHeader("Content-Type");
// RAW audio file encountered
if (headerContentType == "application/octet-stream") {
downSample(rawAudioByteArray);
}
// WAV audio file encountered
else if (headerContentType == "audio/x-wav"
if (headerContentType == "audio/x-wav"
|| headerContentType == "audio/wav"
|| headerContentType == "audio/wave") {
@ -59,7 +54,8 @@ void Sound::replyFinished(QNetworkReply* reply) {
interpretAsWav(rawAudioByteArray, outputAudioByteArray);
downSample(outputAudioByteArray);
} else {
qDebug() << "Unknown audio file 'Content-Type'.";
// Process as RAW file
downSample(rawAudioByteArray);
}
} else {
qDebug() << "Network reply without 'Content-Type'.";