So.. I have a buffer with MP3 data (If I would save this buffer and call it buffer.mp3 it would play, but in this situation I should not save it to file system). I have to play it, but I can not, what shall I do?
I tried the next code to play that buffrer(ByteArray\Stream) (I get MP3 data from server the method of getting data works fine (tested on text int's etc) I call the returned ByteArray readResponse because I have some seading method and It is it's response).
protected function Play(event:MouseEvent):void
{
var mySound:Sound = new Sound();
mySound.addEventListener(SampleDataEvent.SAMPLE_DATA, soundFill);
mySound.play();
}
public function soundFill(event:SampleDataEvent):void
{
event.data.writeBytes(readResponse.buffer, 0, readResponse.buffer.length);
}