如何播放同时下载的音频文件? [英] How to play the audio file that downloaded at the same time?

查看:73
本文介绍了如何播放同时下载的音频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以从Internet下载音频文件(.mp3或.aac)的代码。它完美地运作。但是在适当的时候,我需要在下载时开始播放这个音频文件。怎么做?使用了什么方法?

谢谢!

I have a code that can download the audio file (.mp3 or .aac) from Internet. It works perfectly. But at the right moment, I need to start to play this audio file while it is still downloading. How to do it? What methods are used?
Thanks!

推荐答案

这里你要实现的是典型的producer-consumer pattern [ ^ ]。

制作人将成为音乐文件的下载者,消费者将成为玩家。



做一些研究,你做'很可能甚至会找到一些示例代码。



问候,

- Manfred
What you are trying to implement here follows the typical producer-consumer pattern[^].
The producer will be the downloader of the music file and the consumer will be the player.

Do some research on that and you'll most probably even find some sample code.

Regards,
— Manfred


这篇关于如何播放同时下载的音频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆