Is there a better way to save streamed files with

2019-04-25 00:26发布

问题:

I'm trying to build a mediaplayer app, that allows the user to stream mp3 files from online, and save the file when it's finished downloading.

It looks like MediaPlayer doesn't provide any means of doing this, so existing solutions are a little hacky, and do things like downloading to a separate buffer, and repeatedly stopping/starting the MediaPlayer on buffer updates. As far as I can see, this means small pauses in the audio every time the buffer's swapped, which isn't very good.

Can anyone suggest a better way to do it?