[英]Get base64 from sound url in javascript
我在這里有一個示例聲音 url:http: http://awexsoft.rf.gd/testing/test.mp3
,我想從這個 url 制作一個 base64。 有沒有辦法做到這一點?
const res = await fetch('http://awexsoft.rf.gd/testing/test.mp3');
const data = await res.arrayBuffer();
const b64 = btoa(String.fromCharCode(...new Uint8Array(data)));
console.log(b64);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.