高的,
我正在研究这个编解码器,并且我创建了一个 Uint8Array 对象,它以 TypedArray 作为参数。如何将我的音频文件转换为 TypedArray,以便我可以将其加载到 Uint8Array 中并继续生活?这是我的JsFiddle,这是一段代码摘录:
var buf = new Uint8Array(128); // this wants a typedArray or unsigned long
if (buf.byteLength == 128) {
alert("Yes, we have a 128 byte buffer");
} else {
alert("Nope, it's not 128 bytes");
}
var bitstream = new BitStream(buf);
bitstream.writeBits(12, 0xfff);
bitstream.seekTo(0);
var bs = bitstream.readBits(6);
bitstream.readBits(10);
console.log("did some stuff with bitstream...");
// let's call some amr functions...
//var dcoded = jigg.decode(bs);//decode() takes a "bitstream" as argument
谢谢,
J·威尔斯