Ale*_*ini 2 android text-to-speech ios cordova
我写了一个Cordova应用程序,其中包含由翻译谷歌REST服务提供的TTS,这些应用程序不再可用(从今天开始我想),因为它们需要验证码才能工作.我对此有一些疑问:
- 可以支付服务费吗?(谷歌翻译API V2似乎不是答案......)?- 没有互联网的Android文字转语音是否有效?
- 是否有Cordova插件连接此服务?
- 它是否适用于iOS?
我会谈谈你提出的最后一个问题.是的,iOS有离线TTS服务.这是AVSpeechSynthesizer.
NSString *ttsString = @"Hello Bangladesh";
NSString *language = @"en-US";
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *utterance = [AVSpeechUtterance
speechUtteranceWithString:ttsString];
utterance.rate = 0.5f;
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:language];
[synth speakUtterance:utterance];
Run Code Online (Sandbox Code Playgroud)
您可以看到语言代码列表.
for(AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices])
{
NSLog(@"%@", voice.language);
}
Run Code Online (Sandbox Code Playgroud)