You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I want to encode the AudioBuffer to a string (so it can be stored in localStorage next time) and back again.
This does NOT work:
// Copied from audio-loader/test/support/utils.jsfunctionarrToBase64Audio(arr){vardata=newBuffer(arr).toString("base64");return"data:audio/mp3;base64,"+data;}load("./sounds/coin.mp3").then(audioBuffer=>{console.log(audioBuffer);constasString=arrToBase64Audio(audioBuffer);console.log(asString);console.log(asString.length);load(asString).then(ab=>{//console.log(ab);play(ab);});});
It says:
The buffer passed to decodeAudioData contains an unknown content type.
*Firefox*
*Chrome*
The text was updated successfully, but these errors were encountered:
This works:
But I want to encode the AudioBuffer to a string (so it can be stored in
localStorage
next time) and back again.This does NOT work:
It says:
*Firefox*
*Chrome*
The text was updated successfully, but these errors were encountered: