iPhone SDK:将流式音频文件保存到Documents文件夹 [英] iPhone SDK:Saving a streamed audio file to Documents folder

查看:102
本文介绍了iPhone SDK:将流式音频文件保存到Documents文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个音频文件保存到我的应用程序的Documents文件夹中,而我的应用程序中的一个类正在流式传输它。我该怎么做?

I want to save an audio file to the Documents folder of my application while one of the classes in my app is streaming it. How can I do this?

是否可以将流式音频直接保存到mp3? (如果正在播放的音频文件是mp3或我必须使用caf?)

Is it possible to save the streamed audio directly to an mp3? (if the audio file being streamed is an mp3 or I have to use caf?)

谢谢。


编辑:如果我在另一个线程中运行保存并且用户退出应用程序怎么办?我知道一个应用程序无法在iPhone的后台运行,但有什么办法可以在用户退出应用程序时停止下载并删除部分保存的文件?我可以在类或NSURLConnection的委托中获得退出信号吗?

推荐答案

如果您使用NSURLConnection或CFNetwork下载文件,您可以将其保存在connectionDidFinishLoading委托。

If you are using the NSURLConnection or CFNetwork to download the file you can save it in the connectionDidFinishLoading delegate.

看看Matt Gallaghers
流媒体播放MP3流

Take a look at Matt Gallaghers Streaming and playing an MP3 stream

这篇关于iPhone SDK:将流式音频文件保存到Documents文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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