this should be straight forward, but I am not sure why I am getting the error, I am using constructor with ArrayBuffer as parameter as shown in mdn, but I am getting the error as invalid arguments, (p.s with dataview I have checked, the data is Int16 only)
the code is:
var view= DataView(arrayBuf);
console.log('arrayBuf.byteLength : '+arrayBuf.byteLength);
console.log('data at 0 : '+view.getInt16(0));
console.log('data at 1 : '+view.getInt16(1));
var int16arry = new Int16Array(arrayBuf);
the console output is:
"arrayBuf.byteLength : 117"
"data at 0 : 22720"
"data at 1 : -16315"
Error: invalid arguments
what is my mistake?
117and not117/2, that y i am increasingview.getInt16(0), as 0,1,2, and not `,2,4...