API参考Utility

SpeechManager

语音朗读,朗读笔记或指定文本。

用于 TTS 朗读。通过 SpeechManager.sharedInstance() 获取单例。

类成员 (Class members)

sharedInstance

获取单例。

static sharedInstance(): SpeechManager

Return Value:

  • SpeechManager: 单例对象。

实例成员 (Instance members)

属性

属性类型说明
speakingboolean是否正在朗读。
pausedboolean是否暂停。
sceneWindowUIWindow场景窗口。
languageCodestring语言代码。
canPrevboolean是否可上一句。
canNextboolean是否可下一句。

方法

startSpeechNotes

开始朗读笔记列表。

startSpeechNotes(notes: NSArray): void

Parameters:

NameTypeDescription
notesNSArray包含 MbBookNote 的数组。

stopSpeech

停止朗读。

stopSpeech(): void

pauseSpeech

暂停朗读。

pauseSpeech(): void

continueSpeech

继续朗读。

continueSpeech(): void

prevSpeech

上一句。

prevSpeech(): void

nextSpeech

下一句。

nextSpeech(): void

playText

朗读指定文本。

playText(text: string): void

Parameters:

NameTypeDescription
textstring要朗读的文本。

playText (指定语言)

指定语言朗读文本。

playText(text: string, languageTxt: string): void

Parameters:

NameTypeDescription
textstring要朗读的文本。
languageTxtstring语言代码(如 "en-US")。
头文件API清单

正在加载...

协议:JSBSpeechManager,来源:-