|
用于Azure AI转录(语音转文本)的客户端库,支持实时转录和批量转录。
bash
pip install azure-ai-transcription
bash
TRANSCRIPTION_ENDPOINT=https://<资源名称>.cognitiveservices.azure.com
TRANSCRIPTION_KEY=<你的密钥>
使用订阅密钥进行身份验证(此客户端不支持DefaultAzureCredential):
python
import os
from azure.ai.transcription import TranscriptionClient
client = TranscriptionClient(
endpoint=os.environ[TRANSCRIPTION_ENDPOINT],
credential=os.environ[TRANSCRIPTION_KEY]
)
python
job = client.begin_transcription(
name=会议转录,
locale=en-US,
content_urls=[https://<存储路径>/audio.wav],
diarization_enabled=True
)
result = job.result()
print(result.status)
python
stream = client.beginstreamtranscription(locale=en-US)
stream.sendaudiofile(audio.wav)
for event in stream:
print(event.text)
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 azure-ai-transcription-py-1776376212 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 azure-ai-transcription-py-1776376212 技能
skillhub install azure-ai-transcription-py-1776376212
文件大小: 1.49 KB | 发布时间: 2026-4-17 16:05