SpeechManager
用于 TTS 朗读。通过 SpeechManager.sharedInstance() 获取单例。
类成员 (Class members)
Section titled “类成员 (Class members)”sharedInstance
Section titled “sharedInstance”获取单例。
static sharedInstance(): SpeechManagerReturn Value:
SpeechManager: 单例对象。
实例成员 (Instance members)
Section titled “实例成员 (Instance members)”| 属性 | 类型 | 说明 |
|---|---|---|
speaking | boolean | 是否正在朗读。 |
paused | boolean | 是否暂停。 |
sceneWindow | UIWindow | 场景窗口。 |
languageCode | string | 语言代码。 |
canPrev | boolean | 是否可上一句。 |
canNext | boolean | 是否可下一句。 |
startSpeechNotes
Section titled “startSpeechNotes”开始朗读笔记列表。
startSpeechNotes(notes: NSArray): voidParameters:
| Name | Type | Description |
|---|---|---|
notes | NSArray | 包含 MbBookNote 的数组。 |
stopSpeech
Section titled “stopSpeech”停止朗读。
stopSpeech(): voidpauseSpeech
Section titled “pauseSpeech”暂停朗读。
pauseSpeech(): voidcontinueSpeech
Section titled “continueSpeech”继续朗读。
continueSpeech(): voidprevSpeech
Section titled “prevSpeech”上一句。
prevSpeech(): voidnextSpeech
Section titled “nextSpeech”下一句。
nextSpeech(): voidplayText
Section titled “playText”朗读指定文本。
playText(text: string): voidParameters:
| Name | Type | Description |
|---|---|---|
text | string | 要朗读的文本。 |
playText (指定语言)
Section titled “playText (指定语言)”指定语言朗读文本。
playText(text: string, languageTxt: string): voidParameters:
| Name | Type | Description |
|---|---|---|
text | string | 要朗读的文本。 |
languageTxt | string | 语言代码(如 “en-US”)。 |