2010-09-20 352 views
0

在我的应用程序中,我使用AvAudioplayer播放音频,在播放音频后,我必须记录来自AvAudioplayer的音频和任何其他外部声音以及音频。如何从播放音乐播放器录制音频

我该怎么做。

谢谢

回答

0

使用此功能来播放声音

- (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; 

和U可以这样调用

self.btn_do = [self getNoteFromFilename:@"MusicFileName" andoftype:@"mp3"]; 
功能