Monotouch:在远程服务器上播放 MP3

发布于 2024-09-17 19:53:34 字数 44 浏览 1 评论 0原文

我想播放远程服务器上的 MP3。 如何在 iOS 应用程序中播放 MP3?

I want to play a MP3 which is on a remote server.
What can i do to play the MP3 in a iOS application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱娆 2024-09-24 19:53:34

AVPlayer 可以工作,如果您想要对媒体管道进行低级访问,您可以使用 AVAudioFile API,它可以让您自己流式传输数据,然后将其提供给音频解码器。

请参阅我的示例:

http://github.com/migueldeicaza/monotouch- samples/tree/master/StreamingAudio/

这是一个低级 API,请记住这一点。该示例从远程站点获取自己的文件。

The AVPlayer will work, if you want low-level access to the media pipeline, you can use the AVAudioFile APIs that let you stream the data yourself and then feed it to the audio decoders.

See my sample at:

http://github.com/migueldeicaza/monotouch-samples/tree/master/StreamingAudio/

This is a low-level API, just keep that in mind. The sample does its own file fetching from the remote site.

早乙女 2024-09-24 19:53:34

你可以试试AVPlayer。例如,

avPlayer = MonoTouch.AVFoundation.AVPlayer.FromUrl(new NSUrl("http://www.robtowns.com/music/blind_willie.mp3"));
avPlayer.Play();

查看 MonoTouch 或有关更多详细信息,请参阅 Apple 文档。

You could try AVPlayer. For example,

avPlayer = MonoTouch.AVFoundation.AVPlayer.FromUrl(new NSUrl("http://www.robtowns.com/music/blind_willie.mp3"));
avPlayer.Play();

Check out the MonoTouch or Apple documentation for more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文