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
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TTMLGenerator(options?): TTMLGenerator;Defined in: generator.ts:42
构造一个 TTML 生成器实例
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | GeneratorOptions | 生成器配置选项 在 Node.js 环境下必须注入 domImplementation 和 xmlSerializer 实例(例如用 @xmldom/xmldom 等) |
Returns
Section titled “Returns”TTMLGenerator
Methods
Section titled “Methods”generate()
Section titled “generate()”generate(result): string;Defined in: generator.ts:85
生成 TTML 字符串
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
result | TTMLResult | 包含元数据和歌词行的 TTML 数据结构 |
Returns
Section titled “Returns”string
序列化后的 TTML 字符串
generate()
Section titled “generate()”static generate(result, options?): string;Defined in: generator.ts:72
生成 TTML 字符串的静态便捷方法
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
result | TTMLResult | 包含元数据和歌词行的 TTML 数据结构 |
options? | GeneratorOptions | 生成器配置选项,用于注入 DOM 依赖及自定义部分生成行为 |
Returns
Section titled “Returns”string
序列化后的 TTML 字符串