Text to Speech on iOS

后端 未结 4 1229
清歌不尽
清歌不尽 2021-02-03 16:32

I\'d like to add text to speech on the iOS, but noticed that NSSpeechSynthesizer seems to be missing from Cocoa-Touch.

Are there any third party, commercial or FOSS, lib

4条回答
  •  萌比男神i
    2021-02-03 16:44

    How to programmatically use iOS voice synthesizers? (text to speech)

    Starting from iOS 7 Apple provides the following API...

    https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVSpeechSynthesizer_Ref/Reference/Reference.html

    #import 
    …
    AVSpeechUtterance *utterance = [AVSpeechUtterance 
                                speechUtteranceWithString:@"Hello world"];
    AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
    [synth speakUtterance:utterance];
    

提交回复
热议问题