This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var blob = window.atob("AAAAAAAAAAAAAAAAAACAPwAAAAAAAAAAAAAAAAAAgD8AAAAA"), // Base64 string converted to a char array | |
fLen = blob.length / Float32Array.BYTES_PER_ELEMENT, // How many floats can be made, but be even | |
dView = new DataView( new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT) ), // ArrayBuffer/DataView to convert 4 bytes into 1 float. | |
fAry = new Float32Array(fLen), // Final Output at the correct size | |
p = 0; // Position | |
for(var j=0; j < fLen; j++){ | |
p = j * 4; | |
dView.setUint8(0,blob.charCodeAt(p)); | |
dView.setUint8(1,blob.charCodeAt(p+1)); |