我开发一个应用程序在我所录制的歌曲,并在同一time.I'm从iPod中的音乐库和视图控制器上播放的歌曲wav文件我已经把上点击一下按钮,一个wav文件的开始但是当我开始使用AVAudioRecorder记录,我的wav文件停止工作。 这是我的iPod音乐库中的代码: -
- (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) collection
{
MPMediaItem *item = [[collection items] objectAtIndex:0];
NSURL *url = [item valueForProperty:MPMediaItemPropertyAssetURL];
[self dismissModalViewControllerAnimated: YES];
// Play the item using AVPlayer
AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithURL:url];
player = [[AVPlayer alloc] initWithPlayerItem:playerItem];
[player play];
}
这是我的代码由即时通讯播放wav文件: -
-(void)playAudio:(NSString *)path
{
SystemSoundID soundIDWav;
NSString *sound = [NSString stringWithFormat:@"%@%@",[[NSBundle mainBundle] resourcePath], @"/wavFile.wav"];
NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
AudioServicesCreateSystemSoundID((__bridge CFURLRef)filePath, &soundIDWav);
AudioServicesPlaySystemSound(soundIDWav);
}
我录制这两个由AVAudioRecorder ...请help.Thanks提前...