360 Secure SkillHub
360 安全技能中心

MAI Transcribe

通过 Node 脚本把本地音频文件上传到 Azure AI Speech,使用 MAI-Transcribe-1 模型转写为文本,可指定语言、模型和输出路径,并支持输出原始 JSON 响应;运行前需配置语音资源终结点与密钥。

robotsbuildrobots
robotsbuildrobots
热度 35.33
最近更新 2026-05-11 17:40:48
分类:效率依赖:代码执行 / 读写文件 / 第三方 API应用场景:数据处理 / 文件转换 / 自动化脚本 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add mai-transcribe
Metadata
name
mai-transcribe
description
Transcribe audio with Microsoft's MAI-Transcribe-1 model via Azure AI Speech.
homepage
https://learn.microsoft.com/en-us/azure/ai-services/speech-service/mai-transcribe
metadata
{"clawdbot":{"emoji":"🪟","requires":{"bins":["node"],"env":["AZURE_SPEECH_ENDPOINT","AZURE_SPEECH_KEY"]},"primaryEnv":"AZURE_SPEECH_KEY"}}

MAI-Transcribe-1

Transcribe an audio file via Azure AI Speech using Microsoft's MAI-Transcribe-1 model.

Quick start

node {baseDir}/scripts/transcribe.js /path/to/audio.m4a

Defaults:

  • Model: mai-transcribe-1
  • Output: <input>.txt
  • API version: 2025-10-15

Useful flags

node {baseDir}/scripts/transcribe.js /path/to/audio.ogg --out /tmp/transcript.txt
node {baseDir}/scripts/transcribe.js /path/to/audio.m4a --language en-GB
node {baseDir}/scripts/transcribe.js /path/to/audio.m4a --json --out /tmp/transcript.json
node {baseDir}/scripts/transcribe.js /path/to/audio.wav --model mai-transcribe-1
node {baseDir}/scripts/transcribe.js --help

Required env vars

export AZURE_SPEECH_ENDPOINT="https://YOUR-RESOURCE.cognitiveservices.azure.com"
export AZURE_SPEECH_KEY="YOUR_SPEECH_RESOURCE_KEY"

How to get the API key

  1. Go to the Azure portal and open your Speech or Foundry Speech resource.
  2. Open Keys and Endpoint.
  3. Copy:
    • the resource endpoint, for example https://your-resource.cognitiveservices.azure.com
    • one of the resource keys
  4. Export them:
export AZURE_SPEECH_ENDPOINT="https://YOUR-RESOURCE.cognitiveservices.azure.com"
export AZURE_SPEECH_KEY="YOUR_SPEECH_RESOURCE_KEY"

If gh-style copy-paste chaos is happening, the most important bit is that this skill expects the Speech resource endpoint, not a generic Foundry project URL.

Optional:

export AZURE_SPEECH_API_VERSION="2025-10-15"

API shape

The script calls:

POST {AZURE_SPEECH_ENDPOINT}/speechtotext/transcriptions:transcribe?api-version=2025-10-15

Headers:

  • Ocp-Apim-Subscription-Key: {AZURE_SPEECH_KEY}

Multipart form fields:

  • audio
  • definition

Example definition payload:

{
  "enhancedMode": {
    "enabled": true,
    "model": "mai-transcribe-1"
  }
}

Notes

  • This is the same style of skill as the Whisper one: a small documented script wrapper, not a built-in OpenClaw media pipeline.
  • Tested successfully against a live Azure Speech resource.
  • --json writes the raw Azure response for debugging or downstream processing.
  • Audio is uploaded to Microsoft for processing.