有没有更好的方法来使用 MediaPlayer 保存流媒体文件?
我正在尝试构建一个媒体播放器应用程序,它允许用户从在线流式传输 mp3 文件,并在下载完成后保存文件。
看起来 MediaPlayer 没有提供任何执行此操作的方法,因此现有的解决方案有点 hacky,并且执行诸如下载到单独的缓冲区以及在缓冲区更新时重复停止/启动 MediaPlayer 之类的操作。据我所知,这意味着每次缓冲区交换时音频都会出现小暂停,这不是很好。
任何人都可以建议更好的方法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论