gpt4 book ai didi

cocoa-touch - iOS 上的文字转语音

转载 作者:可可西里 更新时间:2023-11-01 17:02:36 27 4
gpt4 key购买 nike

我想在 iOS 上将文本添加到语音中,但注意到 Cocoa-Touch 中似乎缺少 NSSpeechSynthesizer。

是否有任何您会推荐的第三方、商业或 FOSS 库? Apple 会拒绝包含第三方库的应用程序吗?

最佳答案

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

从 iOS 7 开始,Apple 提供了以下 API...

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

#import <AVFoundation/AVFoundation.h>

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

关于cocoa-touch - iOS 上的文字转语音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5686897/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com