跳转到内容

TTMLGenerator

Defined in: generator.ts:28

TTML 歌词生成器类

用于将内部的 TTMLResult 数据结构序列化为 AMLL 项目使用的 TTML 字符串

https://github.com/amll-dev/amll-ttml-db/wiki/%E6%A0%BC%E5%BC%8F%E8%A7%84%E8%8C%83

new TTMLGenerator(options?): TTMLGenerator;

Defined in: generator.ts:42

构造一个 TTML 生成器实例

ParameterTypeDescription
optionsGeneratorOptions生成器配置选项 在 Node.js 环境下必须注入 domImplementationxmlSerializer 实例(例如用 @xmldom/xmldom 等)

TTMLGenerator

generate(result): string;

Defined in: generator.ts:85

生成 TTML 字符串

ParameterTypeDescription
resultTTMLResult包含元数据和歌词行的 TTML 数据结构

string

序列化后的 TTML 字符串


static generate(result, options?): string;

Defined in: generator.ts:72

生成 TTML 字符串的静态便捷方法

ParameterTypeDescription
resultTTMLResult包含元数据和歌词行的 TTML 数据结构
options?GeneratorOptions生成器配置选项,用于注入 DOM 依赖及自定义部分生成行为

string

序列化后的 TTML 字符串