Azure Ai Transcription Py — Azure AI Transcription Py
v0.1.0Azure AI Transcription SDK for Python. Use for real-time and batch speech-to-text transcription with timestamps and diarization. Triggers: "transcription", "speech to text", "Azure AI Transcription", "Transcription命令行工具ent".
运行时依赖
安装命令
点击复制技能文档
Azure AI Transcription SDK for Python
命令行工具ent 库 for Azure AI Transcription (speech-to-text) with real-time and batch transcription.
安装ation pip 安装 azure-AI-transcription
环境 Variables TRANSCRIPTION_端点=https://.cognitive服务s.azure.com TRANSCRIPTION_KEY=
Authentication
Use subscription key authentication (DefaultAzure凭证 is not supported for this 命令行工具ent):
导入 os from azure.AI.transcription 导入 Transcription命令行工具ent
命令行工具ent = Transcription命令行工具ent( 端点=os.environ["TRANSCRIPTION_端点"], 凭证=os.environ["TRANSCRIPTION_KEY"] )
Transcription (Batch) job = 命令行工具ent.begin_transcription( name="meeting-transcription", locale="en-US", content_urls=["https:///audio.wav"], diarization_enabled=True ) 结果 = job.结果() print(结果.状态)
Transcription (Real-time) 流 = 命令行工具ent.begin_流_transcription(locale="en-US") 流.发送_audio_file("audio.wav") for event in 流: print(event.text)
Best Practices Enable diarization when multiple speakers are present Use batch transcription for long files stored in blob storage Capture timestamps for subtitle generation Specify language to improve recognition accuracy Handle 流ing backpressure for real-time transcription Close transcription 会话s when complete