Is there a better way to save streaming files using MediaPlayer?

I am trying to create a mediaplayer application that allows a user to broadcast mp3 files from the Internet and save the file after it is completed.

It seems MediaPlayer does not provide any means for this, so existing solutions are a bit hacked and do things such as loading into a separate buffer and repeatedly terminating / starting MediaPlayer on buffer updates. As far as I can see, this means small pauses in the sound every time the buffer changes, which is not very good.

Can anyone suggest a better way to do this?

example of an existing solution

+7
source share

All Articles