Copy link to clipboard
Copied
I try to play audio file from c++ socket server installed on user machine. Problem is that when i play file, it`s length is 1 min, but file which is sending via socket is 3 mins.
Here is my function for load data into byte array.
** loading data
private function socketDataHandler(e:ProgressEvent):void
{
if (socket.bytesAvailable)
{
socket.readBytes(bytes, bytes.length, socket.bytesAvailable);
}
}
** play file
var sound:Sound = new Sound();
sound.loadCompressedDataFromByteArray(recordBytes, recordBytes.length);
sound.play();
Where i am wrong?
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now