微信扫码
添加专属顾问
我要投稿
OpenAI新模型,语音文本互转的新选择。 核心内容: 1. OpenAI发布的STT和TTS模型,与Whisper模型的性能和价格对比 2. 新模型在口音、噪音和语速处理上的优势 3. 新增接口功能:时间戳、流式转录和实时API的详细介绍
凌晨 1 点的时候,OpenAI 突然做了三项发布:
剩下的,容我逐个道来。
两款模型:gpt-4o-transcribe 和 gpt-4o-mini-transcribe,比之前的 Whisper 价格更优,性能更好,尤其在处理口音、噪音和不同语速方面表现更佳。
先是价格对比
再是错误率对比(越低越好)
对比自家的 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)
剩下的,是一些接口参数更新:
详细文档:
https://platform.openai.com/docs/guides/speech-to-text
模型名称是 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
这是一个调试语音的 PlayGround,挺好玩的
还可以在右上角,一键导出代码
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-06-14
AI时代如何为企业和个人赋能
2025-06-14
没吃透 Function Calling?难怪你不理解 AI Agent 为何非来不可!
2025-06-14
浅尝一下微软的AutoGen框架
2025-06-14
基于大模型的智能运营 | 智能体式编排,业务流程管理的新阶段
2025-06-14
从Manus爆火看Agent AI的技术演进与市场变革——AI Agent全景研报
2025-06-14
张鹏对谈李广密:Agent 的真问题与真机会,究竟藏在哪里?
2025-06-14
为什么说Maus是未来任务型AI系统的代表?
2025-06-14
AI agent如何进化为天网
2025-05-29
2025-03-20
2025-03-21
2025-04-11
2025-03-20
2025-03-19
2025-03-20
2025-03-19
2025-03-19
2025-03-19
2025-06-14
2025-06-14
2025-06-13
2025-06-13
2025-06-13
2025-06-13
2025-06-12
2025-06-12