Use sound returned from audio engine to set sample rate and sample count since the sound gets resampled by the audio engine. Also, check for an mp3 format in deserialize assets, and otherwise default to wav.

This commit is contained in:
Karishma Chadha 2018-04-13 11:20:16 -04:00
parent 0e0d09c235
commit dca9270730
2 changed files with 9 additions and 4 deletions
src/serialization

View file

@ -38,10 +38,8 @@ const deserializeSound = function (sound, runtime, zip, assetFileName) {
log.error(`Could not find sound file associated with the ${sound.name} sound.`);
return Promise.resolve(null);
}
let dataFormat = null;
if (sound.dataFormat.toLowerCase() === 'wav') {
dataFormat = storage.DataFormat.WAV;
}
const dataFormat = sound.dataFormat.toLowerCase() === 'mp3' ?
storage.DataFormat.MP3 : storage.DataFormat.WAV;
if (!JSZip.support.uint8array) {
log.error('JSZip uint8array is not supported in this browser.');
return Promise.resolve(null);