codecamp

OpenAI 创建音色授权录音

创建音色授权录音

post /audio/voice_consents

上传音色授权录音。

请求体参数

媒体类型为 multipart/form-data。

  • language: string:同意语句的 BCP 47 语言标签,例如 en-US。
  • name: string:授权录音的标签。
  • recording: string:同意录音文件,最大 10 MiB。支持 audio/mpeg、audio/wav、audio/x-wav、audio/ogg、audio/aac、audio/flac、audio/webm 和 audio/mp4。

返回值

  • VoiceConsent object { id, created_at, language, 2 more }

用于授权创建自定义音色的同意录音。

  • id: string

授权录音标识。

  • created_at: integer(Unix 时间戳)

授权录音创建时的Unix时间戳,单位为秒。

  • language: string

授权语句的BCP 47语言标签,例如en-US。

  • name: string

上传授权录音时提供的标签。

  • object: "audio.voice_consent"

对象类型,固定为audio.voice_consent。

  • "audio.voice_consent"

示例

## [中文] 发送POST请求;将示例API凭证及呼叫标识替换为应用使用的值。
curl https://api.openai.com/v1/audio/voice_consents \
    -H 'Content-Type: multipart/form-data' \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -F language=language \
    -F name=name \
    -F 'recording=@/path/to/recording'

响应

中文说明:以下为原文配置、命令或事件示例,字段名、枚举、标识符及数值保留。

{
  "id": "cons_1234",
  "created_at": 0,
  "language": "language",
  "name": "name",
  "object": "audio.voice_consent"
}

示例

## [中文] 发送POST请求;将示例API凭证及呼叫标识替换为应用使用的值。
curl https://api.openai.com/v1/audio/voice_consents \
  -X POST \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F "name=John Doe" \
  -F "language=en-US" \
  -F "recording=@$HOME/consent_recording.wav;type=audio/x-wav"
OpenAI 音频转录流式事件
OpenAI 创建音频翻译接口
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

其他能力与进阶指南

Embeddings 接口参考

审计日志接口参考

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }