from openai import OpenAI
client = OpenAI(
base_url="https://api.qingyuntop.top/v1",
api_key=key
)
audio_file = open("speech.mp3", "rb")
transcript = client.audio.transcriptions.create(
file=audio_file,
model="whisper-1",
response_format="verbose_json",
timestamp_granularities=["word"]
)
print(transcript.words)注意:仅列出词错误率(WER)低于50%的语言,其他语言虽支持但质量可能较低