exportTTML
function exportTTML(ttmlLyric): string;Defined in: index.ts:37
将 AmllLyricResult 对象序列化为 TTML 格式的 XML 字符串的便捷方法
若需要自定义生成选项,建议直接使用 TTMLParser 类
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
ttmlLyric | AmllLyricResult | 包含歌词行列表和元数据的 AmllLyricResult 对象 |
Returns
Section titled “Returns”string
序列化后的 TTML XML 字符串
Remarks
Section titled “Remarks”默认使用全局的 document.implementation 和 XMLSerializer,若为 Nodejs 环境,
必须使用 TTMLGenerator 类注入 domImplementation 和 xmlSerializer,例如 @xmldom/xmldom
Throws
Section titled “Throws”如果没有全局的 DOMImplementation 和 XMLSerializer,抛出错误