AVSpeechSynthesizer가 말하는 동안 내 앱에서보기를 표시하고 말하기를 중지하면보기를 사라지게하고 싶습니다.AVSpeechSynthesizer - AVSpeechSynthesizer가 말하기로 설정되어 있고 말하기가 중지 된 경우
-(void)speakText {
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
float speechSpeed = 0.12;
AVSpeechUtterance *synUtt = [[AVSpeechUtterance alloc] initWithString:textString];
[synUtt setRate:speechSpeed];
[synUtt setVoice:[AVSpeechSynthesisVoice voiceWithLanguage:selectedVoice]];
[synthesizer speakUtterance:synUtt];
//BELOW TO APPEAR AND AND DISAPPEAR
[UIButton beginAnimations:nil context:nil];
[UIButton setAnimationDuration:0.5];
[UIButton setAnimationDelay:0.0];
[UIButton setAnimationCurve:UIViewAnimationCurveEaseOut];
_speakingScrollView.frame = CGRectMake(236, 675, _speakingScrollView.frame.size.width, _speakingScrollView.frame.size.height);
[self.view bringSubviewToFront:_speakingScrollView];
[UIView commitAnimations];
}
나는이 문제를 어떻게 해결할 수없는 것일까 요? 내가 본 사과 문서는
@property(nonatomic, readonly, getter=isSpeaking) BOOL speaking
을 제안하지만 내 응용 프로그램으로이를 구현하는 방법을하지 운동을 할 수 있습니다.
답장을 보내 주셔서 감사합니다. 현재 - (void) speakText를 사용하여 DidFinishSpeechUtterance를 어떻게 호출 할 수 있습니까? @interface ViewController : UIViewController { –
Manesh
델리게이트 패턴 작동 방식에 대해 약간의 정보가 필요 하듯이 들립니다. 델리게이트 객체를 설정하면 해당 객체가 프로토콜을 구현하는 경우 대리자 메소드에 대한 호출을 수신합니다. – Jasarien