views:

111

answers:

2

Hello friends, I am developing a application where i have to save the audio file and later mail it. 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. So please let me know the step wise process or any sample code would be helpful.

Thanks in advance.

+1  A: 

Apple has a nice example (called Speakhere) to record and save audio files: http://developer.apple.com/iphone/library/samplecode/SpeakHere/index.html

In order to send e-mail:

Follow Jasarien's post.

ahmet emrah
Sending an email like that will not attach anything. The questioner specified that the sound clip would need to be attached to the email.
Jasarien
+1  A: 

The Apple Example suggested by Ahmet is a good reference for recording and saving the sound clip.

To email it, look at the documentation for the MessageUI framework. The class you'll want to use is MFMailComposerViewController.

You can use that class to set recipients, subject, body and attatchments.

Jasarien
Thanks for pointing out my error.
ahmet emrah
thnks a lot but if you check the application,the recorded audio cannot be played later, i want to play it later,
cooliphonedeveloper
Of course the code example isn't going to do everything you need it to do. If that was the case, we wouldn't need to write any code, we'd all just use the examples. Look into documentation the AVFoundation framework and it's classes to find out how to play audio. http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVFoundationFramework/AVFoundationFramework.pdf
Jasarien