こんにちは、私は iOS の初心者で、特定のタスクがあります。まず、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 Developer API で検索しましたが、何も見つかりませんでした。