mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
Merge pull request #2095 from PhilipRosedale/master
JS: assume RAW audio if not detected as WAV
This commit is contained in:
commit
1d0bff7a26
1 changed files with 3 additions and 7 deletions
|
@ -44,13 +44,8 @@ void Sound::replyFinished(QNetworkReply* reply) {
|
||||||
|
|
||||||
QByteArray headerContentType = reply->rawHeader("Content-Type");
|
QByteArray headerContentType = reply->rawHeader("Content-Type");
|
||||||
|
|
||||||
// RAW audio file encountered
|
|
||||||
if (headerContentType == "application/octet-stream") {
|
|
||||||
downSample(rawAudioByteArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
// WAV audio file encountered
|
// WAV audio file encountered
|
||||||
else if (headerContentType == "audio/x-wav"
|
if (headerContentType == "audio/x-wav"
|
||||||
|| headerContentType == "audio/wav"
|
|| headerContentType == "audio/wav"
|
||||||
|| headerContentType == "audio/wave") {
|
|| headerContentType == "audio/wave") {
|
||||||
|
|
||||||
|
@ -59,7 +54,8 @@ void Sound::replyFinished(QNetworkReply* reply) {
|
||||||
interpretAsWav(rawAudioByteArray, outputAudioByteArray);
|
interpretAsWav(rawAudioByteArray, outputAudioByteArray);
|
||||||
downSample(outputAudioByteArray);
|
downSample(outputAudioByteArray);
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "Unknown audio file 'Content-Type'.";
|
// Process as RAW file
|
||||||
|
downSample(rawAudioByteArray);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "Network reply without 'Content-Type'.";
|
qDebug() << "Network reply without 'Content-Type'.";
|
||||||
|
|
Loading…
Reference in a new issue