简体   繁体   English

使用iPhone将音频文件保存在文档目录中

[英]Saving an audio file in documents directory with the iphone

I want to develop an iphone application where I have to save the audio file and later mail it. 我想开发一个iphone应用程序,在该应用程序中必须保存音频文件并稍后将其发送。

Can you give me some idea regarding this like the format in which it should be saved so that it can be played later anytime and also mailed? 您能给我一些想法吗,例如应该保存的格式,以便以后可以随时播放并邮寄?

Please let me know the step wise process or any sample code would be helpful. 请让我知道逐步的过程,否则任何示例代码都会有所帮助。

Apple has a nice example (called Speakhere) to record and save audio files: http://developer.apple.com/iphone/library/samplecode/SpeakHere/index.html 苹果公司有一个很好的示例(称为Speakhere)来记录和保存音频文件: http : //developer.apple.com/iphone/library/samplecode/SpeakHere/index.html

In order to send e-mail: 为了发送电子邮件:

Follow Jasarien's post. 跟随Jasarien的帖子。

The Apple Example suggested by Ahmet is a good reference for recording and saving the sound clip. Ahmet建议的Apple Example是录制和保存声音片段的很好参考。

To email it, look at the documentation for the MessageUI framework. 要发送电子邮件,请查看MessageUI框架的文档。 The class you'll want to use is MFMailComposerViewController . 你要使用的类是MFMailComposerViewController

You can use that class to set recipients, subject, body and attatchments. 您可以使用该类来设置收件人,主题,正文和附件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM