创建 Audio Native 项目

创建启用 Audio Native 的项目,可选择开始转换,并返回项目 ID 和可嵌入的 HTML 代码片段。

请求头

xi-api-keystring可选

请求

This endpoint expects a multipart form containing an optional file.
namestring必需

项目名称。

imagestring or null可选Deprecated

(已弃用)播放器使用的图片 URL。未提供时,将使用 Player 设置中的默认图片。

authorstring or null可选
Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
titlestring or null可选

播放器中使用并插入上传文章顶部的标题。未提供时,使用 Player 设置中的默认标题。

smallboolean可选默认为 falseDeprecated

(已弃用)是否使用小型播放器。未提供时,将使用 Player 设置中的默认值。

text_colorstring or null可选

播放器使用的文本颜色。未提供时,使用 Player 设置中的默认文本颜色。

background_colorstring or null可选
Background color used in the player. If not provided, default background color set in the Player settings is used.
sessionizationinteger可选默认为 0Deprecated

(已弃用)指定页面重新加载后会话持续保留的分钟数。未提供时,将使用 Player 设置中的默认会话设置。

voice_idstring or null可选

用于为内容配音的音色 ID。未提供时,使用 Player 设置中的默认音色 ID。

model_idstring or null可选

播放器中使用的 TTS 模型 ID。未提供时,使用 Player 设置中的默认模型 ID。

filefile可选

包含文章内容的 txt 或 HTML 输入文件。HTML 应采用以下格式:‘<html><body><div><p>你的内容</p><h3>更多内容</h3><p>更多内容</p></div></body></html>’

auto_convertboolean可选默认为 false

是否自动将项目转换为音频。

apply_text_normalizationenum or null可选
此参数通过 4 种模式控制文本规范化:'auto'、'on'、'apply_english' 和 'off'。 设为 'auto' 时,系统会自动决定是否应用文本规范化 (例如将数字拼写出来)。设为 'on' 时,始终应用文本规范化;设为 'off' 时则跳过。'apply_english' 与 'on' 相同,但会假定文本为英语。
允许的值:
pronunciation_dictionary_locatorslist of strings可选
以 JSON 字符串列表编码的发音词典定位符(pronunciation_dictionary_id、version_id)列表,用于指定要应用于文本的发音词典。由于添加项目时可能通过 formData 而非 jsonBody,因此必须提供 JSON 编码字符串列表。若要指定多个词典,请在 curl 中使用多行 --form,例如 --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"Vmd4Zor6fplcA7WrINey\",\"version_id\":\"hRPaxjlTdR7wFMhV4w0b\"}"' --form 'pronunciation_dictionary_locators="{\"pronunciation_dictionary_id\":\"JzWtcGQMJ6bnlWwyMo7e\",\"version_id\":\"lbmwxiLu4q6txYxgdZqn\"}"'。

响应

成功响应

project_idstring

已创建的 Audio Native 项目 ID。

convertingboolean

项目当前是否正在转换。

html_snippetstring

用于嵌入 Audio Native 播放器的 HTML 代码片段。

错误

422
Unprocessable Entity Error