凌晨 1 点的时候,OpenAI 突然做了三项发布:
语音转文本(STT)模型
文本转语音(TTS)模型

剩下的,容我逐个道来。

高浓度的主流模型(如 DeepSeek 等)开发交流;
资源对接,与 API、云厂商、模型厂商直接交流反馈的机会;
01
语音转文本(STT)模型
两款模型:gpt-4o-transcribe 和 gpt-4o-mini-transcribe,比之前的 Whisper 价格更优,性能更好,尤其在处理口音、噪音和不同语速方面表现更佳。
先是价格对比
Whisper(OpenAI 部署版): $0.006/min
gpt-4o-transcribe: ~ $0.006/min
再是错误率对比(越低越好)

对比自家的 Whisper

对比竞品模型
这俩 endpoint,一个是 transcriptions,另一个是translations,同样可以用于新模型。前者是纯转文字,简单调用起来是这样:
from openai import OpenAI
client = OpenAI()
audio_file = open("/path/to/file/audio.mp3", "rb")
transcription = client.audio.transcriptions.create(
model="whisper-1",
file=audio_file
)
print(transcription.text)
后者是转文字+翻译(仅限翻译成英文),调用大概这样。
from openai import OpenAI
client = OpenAI()
audio_file = open("/path/to/file/speech.mp3", "rb")
transcription = client.audio.transcriptions.create(
model="whisper-1",
file=audio_file,
response_format="text"
)
print(transcription.text)
剩下的,是一些接口参数更新:
时间戳 (Timestamps):通过设置 timestamp_granularities 参数,可以获取带有时间戳的 JSON 输出,精确到句子片段或单词级别。
流式转录 (Streaming transcriptions):通过设置 stream=True,可以在模型完成音频片段的转录后立即接收到 transcript.text.delta 事件,最终会收到包含完整转录的 transcript.text.done 事件。
详细文档:
https://platform.openai.com/docs/guides/speech-to-text
02
文本转语音(TTS)模型
模型名称是 gpt-4o-mini-tts 可控性很强的 TTS:
可以指定要说的内容,如:“我是练习时长两年半的个人练习生”
中文示例
英文示例
我个人感觉效果不是很好(但可以 roll 点音色);
长度方面,最大支持 2000 token 的内容;
价格方面,约 $0.015/min,示例代码如下:
import asyncio
from openai import AsyncOpenAI
from openai.helpers import LocalAudioPlayer
openai = AsyncOpenAI()
input = """大家好,我是练习时长两年半的个人练习生,你坤坤,喜欢唱、跳、Rap和篮球,music~\n\n在今后的节目中,有我很多作词,作曲,编舞的原创作品,期待的话多多投票吧!"""
instructions = """用娇滴滴的语气,萝莉音"""
asyncdefmain() -> None:
asyncwith openai.audio.speech.with_streaming_response.create(
model="gpt-4o-mini-tts",
voice="alloy",
input=input,
instructions=instructions,
response_format="pcm",
) as response:
await LocalAudioPlayer().play(response)
if __name__ == "__main__":
asyncio.run(main())
详细文档:
https://platform.openai.com/docs/guides/text-to-speech
03
新网站:OpenAI.fm
这是一个调试语音的 PlayGround,挺好玩的
还可以在右上角,一键导出代码

结论
不大的发布,实用的东西:
STT 很实用,Whisper 可以退役了
TTS 效果一般,不推荐用

转载原创文章请添加微信:founderparker
内容中包含的图片若涉及版权问题,请及时与我们联系删除