我使用控件在应用程序 POVoiceHUD 中录制语音。
https://github.com/polatolu/POVoiceHUD
我似乎错过了让文件播放/检索录制的音频的东西。演示项目不包括播放存储在[self.voiceHud startForFilePath:[NSString stringWithFormat:@"%@/Documents/MySound.caf", NSHomeDirectory()]];
我试过使用:
- (IBAction)play:(id)sender {
NSLog(@"playRecording");
// Init audio with playback capability
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/recordTest.caf", [[NSBundle mainBundle] resourcePath]]];
NSError *error;
_voiceHud = [[POVoiceHUD alloc] initWithContentsOfURL:url error:&error];
[_voiceHud play];
}
但是我收到错误incompatible pointer type
,并且no known class selector