📜  base64 到 blob - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:57.734000             🧑  作者: Mango

代码示例1
const byteCharacters = atob(b64);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
  byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], {type: 'audio/mp3'});