Merge pull request #4315 from kchadha/fix-backpack-mp3
Allow putting mp3 sounds in the backpack.
This commit is contained in:
1 file changed
+7
@@ -18,6 +18,13 @@ const soundPayload = sound => {
|
||||
payload.mime = 'audio/x-wav';
|
||||
payload.body = assetDataUrl.replace('data:audio/x-wav;base64,', '');
|
||||
break;
|
||||
case 'mp3':
|
||||
payload.mime = 'audio/mp3';
|
||||
// TODO scratch-storage should be fixed so that encodeDataURI does not
|
||||
// always prepend the wave format header; Once that is fixed, the following
|
||||
// line will have to change.
|
||||
payload.body = assetDataUrl.replace('data:audio/x-wav;base64,', '');
|
||||
break;
|
||||
default:
|
||||
alert(`Cannot serialize for format: ${assetDataFormat}`); // eslint-disable-line
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user