2
我在Blob中有一個WAV文件並將其轉換爲MP3我需要先將其轉換爲Int16Array(以下面的示例爲例:https://github.com/zhuker/lamejs)。如何將Blob轉換爲Int16Array
E.g.
var mp3encoder = new lamejs.Mp3Encoder(2, 44100, 128);
// instead of `var samples = new Int16Array(44100);` I want something like `var samples = new Int16Array(blob);`
var mp3Tmp = mp3encoder.encodeBuffer(samples);
這可能嗎?
您必須使用FileReader API:http://stackoverflow.com/questions/15341912/how-to-go-from-blob-to-arraybuffer – lipp