[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FD95GAEWPT6PHENTJSS407":3,"skill-same:01M6FD95GAEWPT6PHENTJSS407":52},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M6FD95GAEWPT6PHENTJSS407","azure-speech-to-text-rest-py",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-speech-to-text-rest-py\u002FSKILL.md",[],[18,19,20,21,22,23,24],"azure","azure speech to text rest py","speech","REST","text","speech to text","azure speech","2026-11-10 10:12:30",false,"# Azure Speech to Text REST API for Short Audio\n\nSimple REST API for speech-to-text transcription of short audio files (up to 60 seconds). No SDK required - just HTTP requests.\n\n## Prerequisites\n\n1. **Azure subscription** - [Create one free](https:\u002F\u002Fazure.microsoft.com\u002Ffree\u002F)\n2. **Speech resource** - Create in [Azure Portal](https:\u002F\u002Fportal.azure.com\u002F#create\u002FMicrosoft.CognitiveServicesSpeechServices)\n3. **Get credentials** - After deployment, go to resource > Keys and Endpoint\n\n## Environment Variables\n\n```bash\n# Required\nAZURE_SPEECH_KEY=\u003Cyour-speech-resource-key>\nAZURE_SPEECH_REGION=\u003Cregion>  # e.g., eastus, westus2, westeurope\n\n# Alternative: Use endpoint directly\nAZURE_SPEECH_ENDPOINT=https:\u002F\u002F\u003Cregion>.stt.speech.microsoft.com\n```\n\n## Installation\n\n```bash\npip install requests\n```\n\n## Quick Start\n\n```python\nimport os\nimport requests\n\ndef transcribe_audio(audio_file_path: str, language: str = \"en-US\") -> dict:\n    \"\"\"Transcribe short audio file (max 60 seconds) using REST API.\"\"\"\n    region = os.environ[\"AZURE_SPEECH_REGION\"]\n    api_key = os.environ[\"AZURE_SPEECH_KEY\"]\n    \n    url = f\"https:\u002F\u002F{region}.stt.speech.microsoft.com\u002Fspeech\u002Frecognition\u002Fconversation\u002Fcognitiveservices\u002Fv1\"\n    \n    headers = {\n        \"Ocp-Apim-Subscription-Key\": api_key,\n        \"Content-Type\": \"audio\u002Fwav; codecs=audio\u002Fpcm; samplerate=16000\",\n        \"Accept\": \"application\u002Fjson\"\n    }\n    \n    params = {\n        \"language\": language,\n        \"format\": \"detailed\"  # or \"simple\"\n    }\n    \n    with open(audio_file_path, \"rb\") as audio_file:\n        response = requests.post(url, headers=headers, params=params, data=audio_file)\n    \n    response.raise_for_status()\n    return response.json()\n\n# Usage\nresult = transcribe_audio(\"audio.wav\", \"en-US\")\nprint(result[\"DisplayText\"])\n```\n\n## Audio Requirements\n\n| Format | Codec | Sample Rate | Notes |\n|--------|-------|-------------|-------|\n| WAV | PCM | 16 kHz, mono | **Recommended** |\n| OGG | OPUS | 16 kHz, mono | Smaller file size |\n\n**Limitations:**\n- Maximum 60 seconds of audio\n- For pronunciation assessment: maximum 30 seconds\n- No partial\u002Finterim results (final only)\n\n## Content-Type Headers\n\n```python\n# WAV PCM 16kHz\n\"Content-Type\": \"audio\u002Fwav; codecs=audio\u002Fpcm; samplerate=16000\"\n\n# OGG OPUS\n\"Content-Type\": \"audio\u002Fogg; codecs=opus\"\n```\n\n## Response Formats\n\n### Simple Format (default)\n\n```python\nparams = {\"language\": \"en-US\", \"format\": \"simple\"}\n```\n\n```json\n{\n  \"RecognitionStatus\": \"Success\",\n  \"DisplayText\": \"Remind me to buy 5 pencils.\",\n  \"Offset\": \"1236645672289\",\n  \"Duration\": \"1236645672289\"\n}\n```\n\n### Detailed Format\n\n```python\nparams = {\"language\": \"en-US\", \"format\": \"detailed\"}\n```\n\n```json\n{\n  \"RecognitionStatus\": \"Success\",\n  \"Offset\": \"1236645672289\",\n  \"Duration\": \"1236645672289\",\n  \"NBest\": [\n    {\n      \"Confidence\": 0.9052885,\n      \"Display\": \"What's the weather like?\",\n      \"ITN\": \"what's the weather like\",\n      \"Lexical\": \"what's the weather like\",\n      \"MaskedITN\": \"what's the weather like\"\n    }\n  ]\n}\n```\n\n## Chunked Transfer (Recommended)\n\nFor lower latency, stream audio in chunks:\n\n```python\nimport os\nimport requests\n\ndef transcribe_chunked(audio_file_path: str, language: str = \"en-US\") -> dict:\n    \"\"\"Stream audio in chunks for lower latency.\"\"\"\n    region = os.environ[\"AZURE_SPEECH_REGION\"]\n    api_key = os.environ[\"AZURE_SPEECH_KEY\"]\n    \n    url = f\"https:\u002F\u002F{region}.stt.speech.microsoft.com\u002Fspeech\u002Frecognition\u002Fconversation\u002Fcognitiveservices\u002Fv1\"\n    \n    headers = {\n        \"Ocp-Apim-Subscription-Key\": api_key,\n        \"Content-Type\": \"audio\u002Fwav; codecs=audio\u002Fpcm; samplerate=16000\",\n        \"Accept\": \"application\u002Fjson\",\n        \"Transfer-Encoding\": \"chunked\",\n        \"Expect\": \"100-continue\"\n    }\n    \n    params = {\"language\": language, \"format\": \"detailed\"}\n    \n    def generate_chunks(file_path: str, chunk_size: int = 1024):\n        with open(file_path, \"rb\") as f:\n            while chunk := f.read(chunk_size):\n                yield chunk\n    \n    response = requests.post(\n        url, \n        headers=headers, \n        params=params, \n        data=generate_chunks(audio_file_path)\n    )\n    \n    response.raise_for_status()\n    return response.json()\n```\n\n## Authentication Options\n\n### Option 1: Subscription Key (Simple)\n\n```python\nheaders = {\n    \"Ocp-Apim-Subscription-Key\": os.environ[\"AZURE_SPEECH_KEY\"]\n}\n```\n\n### Option 2: Bearer Token\n\n```python\nimport requests\nimport os\n\ndef get_access_token() -> str:\n    \"\"\"Get access token from the token endpoint.\"\"\"\n    region = os.environ[\"AZURE_SPEECH_REGION\"]\n    api_key = os.environ[\"AZURE_SPEECH_KEY\"]\n    \n    token_url = f\"https:\u002F\u002F{region}.api.cognitive.microsoft.com\u002Fsts\u002Fv1.0\u002FissueToken\"\n    \n    response = requests.post(\n        token_url,\n        headers={\n            \"Ocp-Apim-Subscription-Key\": api_key,\n            \"Content-Type\": \"application\u002Fx-www-form-urlencoded\",\n            \"Content-Length\": \"0\"\n        }\n    )\n    response.raise_for_status()\n    return response.text\n\n# Use token in requests (valid for 10 minutes)\ntoken = get_access_token()\nheaders = {\n    \"Authorization\": f\"Bearer {token}\",\n    \"Content-Type\": \"audio\u002Fwav; codecs=audio\u002Fpcm; samplerate=16000\",\n    \"Accept\": \"application\u002Fjson\"\n}\n```\n\n## Query Parameters\n\n| Parameter | Required | Values | Description |\n|-----------|----------|--------|-------------|\n| `language` | **Yes** | `en-US`, `de-DE`, etc. | Language of speech |\n| `format` | No | `simple`, `detailed` | Result format (default: simple) |\n| `profanity` | No | `masked`, `removed`, `raw` | Profanity handling (default: masked) |\n\n## Recognition Status Values\n\n| Status | Description |\n|--------|-------------|\n| `Success` | Recognition succeeded |\n| `NoMatch` | Speech detected but no words matched |\n| `InitialSilenceTimeout` | Only silence detected |\n| `BabbleTimeout` | Only noise detected |\n| `Error` | Internal service error |\n\n## Profanity Handling\n\n```python\n# Mask profanity with asterisks (default)\nparams = {\"language\": \"en-US\", \"profanity\": \"masked\"}\n\n# Remove profanity entirely\nparams = {\"language\": \"en-US\", \"profanity\": \"removed\"}\n\n# Include profanity as-is\nparams = {\"language\": \"en-US\", \"profanity\": \"raw\"}\n```\n\n## Error Handling\n\n```python\nimport requests\n\ndef transcribe_with_error_handling(audio_path: str, language: str = \"en-US\") -> dict | None:\n    \"\"\"Transcribe with proper error handling.\"\"\"\n    region = os.environ[\"AZURE_SPEECH_REGION\"]\n    api_key = os.environ[\"AZURE_SPEECH_KEY\"]\n    \n    url = f\"https:\u002F\u002F{region}.stt.speech.microsoft.com\u002Fspeech\u002Frecognition\u002Fconversation\u002Fcognitiveservices\u002Fv1\"\n    \n    try:\n        with open(audio_path, \"rb\") as audio_file:\n            response = requests.post(\n                url,\n                headers={\n                    \"Ocp-Apim-Subscription-Key\": api_key,\n                    \"Content-Type\": \"audio\u002Fwav; codecs=audio\u002Fpcm; samplerate=16000\",\n                    \"Accept\": \"application\u002Fjson\"\n                },\n                params={\"language\": language, \"format\": \"detailed\"},\n                data=audio_file\n            )\n        \n        if response.status_code == 200:\n            result = response.json()\n            if result.get(\"RecognitionStatus\") == \"Success\":\n                return result\n            else:\n                print(f\"Recognition failed: {result.get('RecognitionStatus')}\")\n                return None\n        elif response.status_code == 400:\n            print(f\"Bad request: Check language code or audio format\")\n        elif response.status_code == 401:\n            print(f\"Unauthorized: Check API key or token\")\n        elif response.status_code == 403:\n            print(f\"Forbidden: Missing authorization header\")\n        else:\n            print(f\"Error {response.status_code}: {response.text}\")\n        \n        return None\n        \n    except requests.exceptions.RequestException as e:\n        print(f\"Request failed: {e}\")\n        return None\n```\n\n## Async Version\n\n```python\nimport os\nimport aiohttp\nimport asyncio\n\nasync def transcribe_async(audio_file_path: str, language: str = \"en-US\") -> dict:\n    \"\"\"Async version using aiohttp.\"\"\"\n    region = os.environ[\"AZURE_SPEECH_REGION\"]\n    api_key = os.environ[\"AZURE_SPEECH_KEY\"]\n    \n    url = f\"https:\u002F\u002F{region}.stt.speech.microsoft.com\u002Fspeech\u002Frecognition\u002Fconversation\u002Fcognitiveservices\u002Fv1\"\n    \n    headers = {\n        \"Ocp-Apim-Subscription-Key\": api_key,\n        \"Content-Type\": \"audio\u002Fwav; codecs=audio\u002Fpcm; samplerate=16000\",\n        \"Accept\": \"application\u002Fjson\"\n    }\n    \n    params = {\"language\": language, \"format\": \"detailed\"}\n    \n    async with aiohttp.ClientSession() as session:\n        with open(audio_file_path, \"rb\") as f:\n            audio_data = f.read()\n        \n        async with session.post(url, headers=headers, params=params, data=audio_data) as response:\n            response.raise_for_status()\n            return await response.json()\n\n# Usage\nresult = asyncio.run(transcribe_async(\"audio.wav\", \"en-US\"))\nprint(result[\"DisplayText\"])\n```\n\n## Supported Languages\n\nCommon language codes (see [full list](https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fai-services\u002Fspeech-service\u002Flanguage-support)):\n\n| Code | Language |\n|------|----------|\n| `en-US` | English (US) |\n| `en-GB` | English (UK) |\n| `de-DE` | German |\n| `fr-FR` | French |\n| `es-ES` | Spanish (Spain) |\n| `es-MX` | Spanish (Mexico) |\n| `zh-CN` | Chinese (Mandarin) |\n| `ja-JP` | Japanese |\n| `ko-KR` | Korean |\n| `pt-BR` | Portuguese (Brazil) |\n\n## Best Practices\n\n1. **Use WAV PCM 16kHz mono** for best compatibility\n2. **Enable chunked transfer** for lower latency\n3. **Cache access tokens** for 9 minutes (valid for 10)\n4. **Specify the correct language** for accurate recognition\n5. **Use detailed format** when you need confidence scores\n6. **Handle all RecognitionStatus values** in production code\n\n## When NOT to Use This API\n\nUse the Speech SDK or Batch Transcription API instead when you need:\n\n- Audio longer than 60 seconds\n- Real-time streaming transcription\n- Partial\u002Finterim results\n- Speech translation\n- Custom speech models\n- Batch transcription of many files\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| [references\u002Fpronunciation-assessment.md](references\u002Fpronunciation-assessment.md) | Pronunciation assessment parameters and scoring |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fazure-speech-to-text-rest-py",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill azure-speech-to-text-rest-py",{"tool":44,"command":45},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill azure-speech-to-text-rest-py",{"tool":47,"command":48},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill azure-speech-to-text-rest-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-speech-to-text-rest-py\u002FSKILL.md",true,[],[53,67,77,86,92,99],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":63,"publishedAt":25},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[58],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[64,65,66],"model","model hierarchy","model hierarchy skill",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":73,"publishedAt":25},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[72],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},[74,75,76],"MCP","zoom","zoom mcp",{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":25},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[83,84,85,75],"sdk","zoom apps sdk","apps",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":25},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[88],{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":98,"publishedAt":25},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[97],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},[94],{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":25},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[101]]