views:

45

answers:

2

Hi All,

In my application i am playing audio using AvAudioplayer, after playing the audio i have to record the audio from AvAudioplayer and any other external noices along with the audio.

How can i do that.

Thank You

A: 

Hey Did you mean how to record from iPhone's microphone ?

Bobj-C
Georg Fritzsche
No, dont mean by using iPhone's microphone. in my application i will play a audio file i want to play that audio file.
kiri
A: 

hey, use this function to play sounds

- (AVAudioPlayer *)getNoteFromFilename:(NSString *)name andoftype:(NSString *)type{
NSString *soundPath = [[NSBundle mainBundle] pathForResource:name
                                                      ofType:type];
NSURL *fileURL = [NSURL fileURLWithPath:soundPath];
AVAudioPlayer *note = [[[AVAudioPlayer alloc] initWithContentsOfURL:fileURL
                                                              error:nil] autorelease];
return note;

and u can call the function like this

self.btn_do = [self getNoteFromFilename:@"MusicFileName" andoftype:@"mp3"];
Bobj-C