avspeechutterance

OBJC AVSpeechUtterance writeUtterance how?

[亡魂溺海] 提交于 2021-01-29 16:16:50
问题 I am trying to create a TTS to file in Objc. Since iOS13 can write it to a file. But I'm stuck with writeUtterance:toBufferCallback. Do someone has an exemple with this function in objc? [synth speakUtterance:utterance]; 回答1: Referring to the potential answer in Swift, this would be the Objective-C implementation AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init]; AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:@"test 123"]; AVSpeechSynthesisVoice

Join 2 different labels for text to speech conversion (swift3)

倖福魔咒の 提交于 2020-01-24 19:35:09
问题 Using the speech to text feature I can easily get one label to be spoken. But I want utterance2 to be joined to utterance. I want utterance to be spoken first then when it is finished for utterance2 to be spoken right after. let utterance = AVSpeechUtterance(string: dptext.text!) let utterance2 = AVSpeechUtterance(string: dptext2.text!) let synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterance) 回答1: I think the simplest way to handle this situation is to combine the two string with