MRSpeechDispatcher 0.0.1

MRSpeechDispatcher 0.0.1

测试已测试
Lang语言 Obj-CObjective C
许可协议 MIT
发布最新发布2015年9月

Héctor Marqués 维护。



  • 撰文
  • hectr

MRSpeechDispatcher 提供了一个易于使用的接口,用于在 iOS 设备上从文本生成合成语音

MRSpeechDispatcher *dispatcher = MRSpeechDispatcher.defaultSpeechDispatcher;
dispatcher.reusedSynthesizer = [[AVSpeechSynthesizer alloc] init];
[dispatcher speechText:@"Now relax." withAnimus:MRSpeechAnimusGlad];
[dispatcher speechText:@"And close your eyes." withAnimus:MRSpeechAnimusRegular];
[dispatcher keepQuiteFor:2];
[dispatcher speechText:@"Well done!" withAnimus:MRSpeechAnimusGlad];
[dispatcher speechText:@"See you the next session!" withAnimus:MRSpeechAnimusHurry];

在上述示例中,调度器通过将生成的 AVSpeechUtterance 实例包装成 MRSpeechUtteranceOperation 对象并添加到其 NSOperationQueue 中来排队将要说的文本。

MRSpeechUtteranceOperation 也可以像任何其他 NSOperation 实例一样独立地创建和使用

AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"hello"];
NSOperation *operation = [MRSpeechUtteranceOperation speechOperationWithUtterance:utterance];
[operation start];

用法

要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install

安装

手动安装

执行以下步骤

许可协议

MRSpeechDispatcher 使用 MIT 许可协议。有关更多信息,请参阅 LICENSE 文件。