0

I've tried to mix Audio playback with the URLStream and FileStream classes. My idea was to stream the file to disk to save memory and use the sampleData event of the Audio class to play some audio. Is it possible to access the streamed file while it is streaming somehow to feed the Audio class?

This is interesting because there are large podcasts out there that takes a lot of memory. The current solution is to delete the audio class when the user changes the track and it is working fine, but I want to make it even better.

Tibor Szasz
  • 3,028
  • 2
  • 18
  • 23
  • Both this and the post previous to it by Alex within the AIR tags on SO are very tightly related. I believe for using the sampleData you'll need the decoded RAW wav data from the MP3, there's some solutions in this SO thread http://stackoverflow.com/questions/53411/wav-mp3-for-flashas3 but it would seem you'd need to potentially look at using the NDK to do the processing quickly and use Merapi or some other means to communicate between the NDK service for decoding and your AS3 project for fetching and ultimately playing the audio. – shaunhusain Mar 19 '12 at 20:50
  • To simplify things you could potentially do the MP3 decoding server side (making the request through a proxy) but you'll end up with far more data streaming across the data connection which is probably unacceptable. – shaunhusain Mar 19 '12 at 20:51
  • After discussing this with a co-worker who has used the NDK he suggests looking into using Red5 to achieve RTMP based streaming, if the mp3 files are located on third party servers you may need to either write a Red5 extension or setup a service to pull the files down to your Red5 server in order to stream the data. – shaunhusain Mar 19 '12 at 21:14

0 Answers0