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