How to save audio data recorded using AVAudioRecorder for further use?

Your can do it like this to record it into your documents directory.

Up vote 0 down vote favorite share g+ share fb share tw.

Hi I am creating application which can record sound. I can have that recorded sound file and I can play it immediately. I do not know how can I save it on iPhone so that I can play it after reopening application.

Is there any way by which this file will be stored as application save data? Thanks in advance. Iphone ios5 ios5-sdk link|improve this question edited Nov 7 '11 at 12:40Oliver4,16831253 asked Nov 7 '11 at 11:58KodeKiller707 100% accept rate.

– Michael Dautermann Nov 7 '11 at 12:06 I take NSURL *soundFileURL = NSURL fileURLWithPath:soundFilePath; and then audioRecorder = AVAudioRecorder alloc initWithURL:soundFileURL settings:recordSettings error:&error; and whenever I play the recorded sound I do audioPlayer = AVAudioPlayer alloc initWithContentsOfURL:audioRecorder. Url error:&error; – KodeKiller Nov 7 '11 at 12:15.

Your can do it like this to record it into your documents directory : NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = paths objectAtIndex:0; NSString *filePath = documentsDirectory stringByAppendingPathComponent:@"audioFile. Ext"; // Where ext is the audio format extension you have recorded your sound yourAudioPlayer. Data writeToFile:filePath atomically:YES.

Thanks! It worked. – KodeKiller Nov 8 '11 at 5:36.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions