0
안녕하세요 저는 iOS에서 새로운 제품입니다. 특정 작업을 수행하기 전에 먼저 AVAudioRecorder에서 소리를 녹음하고 문제없이 녹음하고 재생할 수 있지만,AVAudioRecorder에서 바이트 가져 오기
@interface recordViewController : UIViewController <AVAudioRecorderDelegate, AVAudioPlayerDelegate>
{
AVAudioRecorder *audioRecorder;
AVAudioPlayer *audioPlayer;
UIButton *playButton;
UIButton *recordButton;
UIButton *stopButton;
}
기록 : :
-(void) recordAudio {
if (!audioRecorder.recording)
{
playButton.enabled = NO;
stopButton.enabled = YES;
[audioRecorder record];
}
}
재생 :
-(void) playAudio {
if (!audioRecorder.recording)
{
stopButton.enabled = YES;
recordButton.enabled = NO;
NSError *error;
audioPlayer = [[AVAudioPlayer alloc]
initWithContentsOfURL:audioRecorder.url
error:&error];
audioPlayer.delegate = self;
if (error)
NSLog(@"Error: %@", [error localizedDescription]);
else
[audioPlayer play];
}
}
호 기록은 여기 내 함수입니다 데이터를 기록에 넣을 수 있습니까? iOS 개발자 API를 검색 한 결과 아무 것도 찾을 수 없었습니다. 고맙습니다.