Hello,

I've found this function from stackoverflow here: http://stackoverflow.com/questions/5...ong-lines-java

The function:
Code:
function encode(data)
{
    var str = String.fromCharCode.apply(null,data);
    return btoa(str).replace(/.{76}(?=.)/g,'$&\n');
}
I've tried to convert an array of byte with the function unsuccessful.
My byte array of data looks like this:
Code:
ByteData = [78, 255, 98, 247, 156, ..., 160];
It is generated dynamically via dataview of Uint8Array like this:
Code:
ByteData = new Uint8Array(BitCount);

for (var i = 0; i < ByteData.length; ++i) {
     // ByteData.length = 2048
}
How do I generate the result that looks like this:
Code:
T2dnUwACAAAAAAAAAAA+HAAAAAAAAGyawCEBQGZpc2hlYWQAAwAAAAAAAAAAAAAA6AMAAAAAAAAAAAAAAAAAAOgDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPZ2dTAAIAAAAAAAAAAINDAAAAAAAA9LkergEeAXZvcmJpcwAAAAACRKwAAAAAAAAA7gIAAAAAALgBT2dnUwAAAAAAAAAAAAA+HAAAAQAAAPvOJxcBUGZpc2JvbmUALAAAAINDAAADAAAARKwAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAABDb250ZW50LVR5cGU6IGF1ZGlvL3ZvcmJpcw0KT2dnUwAAAAAAAAAAAACDQwAAAQAAAGLSAC4Qdv
For further in formation it's sound data. Once I convert the binary data to base64 format I can play it with the <audio> tag.

Hope I explain clearly and thanks in advance