iPhone - 用于文本转语音功能的 API

发布于 2024-11-27 03:20:44 字数 1539 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

末蓝 2024-12-04 03:20:44

我曾经遇到过这个问题,并在 iPhone 上运行了 Flite(festival lite)文本转语音引擎。我最近为它做了一个API类。我试图让添加到新项目和现有项目变得容易(并且免费)。可以在此处下载。

I ran into this problem at one point, and got Flite (festival lite) text to speech engine running on iPhone. I recently made an API class for it. I tried to make it easy (and free) to add to new and existing projects. It can be downloaded at here.

晨敛清荷 2024-12-04 03:20:44

iPhone 3GS 有专用的 VoiceServices 框架可以做到这一点。 Steve Troughton-Smith 介绍了如何使用私有类 VSSpeechSynthesizer 此处,但你几乎没有机会将使用它的东西进入 App Store。

The iPhone 3G S has the private VoiceServices framework which can do this. Steve Troughton-Smith describes how to use the private class VSSpeechSynthesizer here, but you have little chance of getting something using this into the App Store.

¢蛋碎的人ぎ生 2024-12-04 03:20:44

对于 iOS 5 或 6 - 没有任何内置内容。您需要使用第三方库。

对于 iOS 7,有一个 AVSpeechSynthesizer API。

这是一个简单的例子:

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

For iOS 5 or 6 - nothing built-in. You need to use a third party library.

For iOS 7 there is a AVSpeechSynthesizer API.

Here's a simple example:

AVSpeechUtterance *utterance = [AVSpeechUtterance 
                                speechUtteranceWithString:@"Hello world"];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
[synth speakUtterance:utterance];
爺獨霸怡葒院 2024-12-04 03:20:44

OpenEars 是一个开源 iOS 库,用于实现往返英语语音识别和文本到- iPhone 和 iPad 上的语音,它使用 CMU Pocketsphinx、CMU Flite 和 MITLM 库。

OpenEars is an open-source iOS library for implementing round-trip English language speech recognition and text-to-speech on the iPhone and iPad, which uses the CMU Pocketsphinx, CMU Flite, and MITLM libraries.

纵情客 2024-12-04 03:20:44

我找到了这个,但我还没有尝试过。

I found this but i haven't tried it yet.

你怎么敢 2024-12-04 03:20:44

API 文档会提示该 API 不可用。

The API docs would suggest that the API is not available.

夜访吸血鬼 2024-12-04 03:20:44

您可能还想看看这个

它使用 Flite。它不包含具体说明,但可以为您提供想法。

You might also want to have a look at this.

It uses Flite. It doesn't contain specific instructions but it can give you ideas.

假扮的天使 2024-12-04 03:20:44

对于 iOS 5 或 6 - 没有任何内置内容。您需要使用第三方

对于 iOS 7,有一个 AVSpeechSynthesizer API。

源代码也可在 Github 中获取,

请参阅以下链接

For iOS 5 or 6 - nothing built-in. You need to use a third party library.

For iOS 7 there is a AVSpeechSynthesizer API.

Source Code also available in Github

Refer the Below Link

メ斷腸人バ 2024-12-04 03:20:44

这是可能的,但你必须自己动手。我见过一个应用程序这样做。

This is possible, but you will have to roll your own. I have seen an app do this.

橘和柠 2024-12-04 03:20:44

我在 iPhone 2.0 出现之前就通过将 espeak 移植到该平台来做到这一点。我将它用作命令行实用程序,但应该可以将其放入库中。

I did this before iPhone 2.0 came out by porting espeak to the platform. I used it as a command line utility but it should be possible to make it into a library.

夜巴黎 2024-12-04 03:20:44

Google TTS 限制为 100 个字符。

因此,您应该将长句子分成 100 个字符的小块,并将其传递给 Google TTS 方法。

您可以通过实施以下步骤来实现这一目标。

  • 将长句子分成 100 个字符的小块。
  • 使用第一个分割的 100 个字符串调用 Google TTS。
  • 使用 Google TTS 和 Google TTS 播放它AVAudioPlayer
  • 实现 AVAudioPlayer audioPlayerDidFinishPlaying 委托。
  • 在该委托中,使用第二个分割的 100 个字符调用 Google TTS
    细绳。
  • 递归调用该过程,直到到达最后一个字符。

这是最适合我的 Google-TTS-Library-For-iOS 库 尝试一下:)

Google TTS limited to 100 characters.

So you should split-up your long sentence in to small 100 character chunks and pass it to the Google TTS method.

You can achieve this through implementing below steps.

  • Split-up your long sentence in to small 100 character chunks.
  • Call Google TTS with first split 100 character string.
  • Play it using Google TTS & AVAudioPlayer
  • Implement AVAudioPlayer audioPlayerDidFinishPlaying delegate .
  • In that delegate, call Google TTS with second split 100 character
    string.
  • Call the process recursively until reach the last character.

Here is best One for me Google-TTS-Library-For-iOS library try it :)

好倦 2024-12-04 03:20:44

有一个 Iphone 应用程序可以直接 TTS,在 Itunes 上搜索“TTSMessenger”

There's an Iphone app that does direct TTS, Search for "TTSMessenger" on Itunes

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文