开发者

How to locally cache audio when streaming with Sound.load() in Adobe AIR?

开发者 https://www.devze.com 2023-01-18 01:43 出处:网络
I\'m building a mobile MP3 player with AIR, which streams audio using the Sound class\'s .load() functi开发者_如何学Goon. I\'d like to cache this audio as it\'s downloaded, to the the user\'s SD card.

I'm building a mobile MP3 player with AIR, which streams audio using the Sound class's .load() functi开发者_如何学Goon. I'd like to cache this audio as it's downloaded, to the the user's SD card.

Is this possible without having to download the file twice??


Sound class has extract() method which fills ByteArray with raw sound data. Note that this will be uncompressed samples taking up lot of space.


Thanks, I ended up opting for background downloading with URLStream, and only using Sound.load() to kick off the first song.

Thinking that I could download, decompress, playback and write to file at the same time was probably a bit ambitious!!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号