跳到正文
cccskills
Microsoft 官方免费在 GitHub 公开

tts-voiceover

Text-to-speech voice-over generation from YAML speaker notes using Azure AI Speech neural voices with SSML pronunciation control

中文简介正在准备中。当前显示原文说明。

集成工具PowerPointAzure
查看安装方法

包含的文件(24)

  • SKILL.md11.7 KB
  • pip-audit-known-vulnerabilities.txt260 B
  • pyproject.toml1.7 KB
  • scripts/embed_audio.py11.5 KB
  • scripts/embed-audio.sh2.2 KB
  • scripts/generate_voiceover.py16.9 KB
  • scripts/generate-voiceover.sh2.8 KB
  • scripts/Invoke-EmbedAudio.ps12.5 KB
  • scripts/Invoke-GenerateVoiceover.ps14.3 KB
  • scripts/Modules/TtsVoiceoverHelpers.psm12.1 KB
  • SECURITY.md23.2 KB
  • tests/conftest.py8.4 KB
  • tests/corpus/0_acronym_text19 B
  • tests/corpus/0_empty0 B
  • tests/corpus/0_ssml_fragment29 B
  • tests/corpus/0_valid_yaml25 B
  • tests/fuzz_harness.py6.0 KB
  • tests/Invoke-GenerateVoiceover.Tests.ps12.3 KB
  • tests/test_embed_audio_integrity.py6.0 KB
  • tests/test_embed_audio.py6.1 KB
  • tests/test_generate_voiceover_boundaries.py9.1 KB
  • tests/test_generate_voiceover.py10.5 KB
  • tests/TtsVoiceoverHelpers.Tests.ps14.9 KB
  • uv.lock199.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

TTS Voice Over Skill

Generates per-slide WAV voice-over files from YAML speaker_notes using Azure AI Speech neural voices with SSML pronunciation control.

Overview

This skill reads content.yaml files from a PowerPoint skill content directory, extracts speaker_notes fields, applies acronym aliases for correct pronunciation of technical terms, and produces one WAV file per slide. Supports dry-run mode for SSML template verification without Azure credentials.

Synthesis uses Azure AI Speech neural voices, including the HD voices such as en-US-Andrew:DragonHDLatestNeural. HD voices are offered in a subset of Azure regions; check the Speech service regions before choosing SPEECH_REGION.

Narration produced by this skill is synthetic. Tell listeners that the voice is AI-generated, following Microsoft's disclosure design guidelines for synthetic voices. HVE demo-material CI does not synthesize speech; it generates silent videos.

Prerequisites

  • Azure Speech resource: see Azure AI Speech pricing for the free-tier allowance and HD voice rates.
  • Authentication: Microsoft Entra ID (SPEECH_RESOURCE_ID, recommended) or a resource key (SPEECH_KEY).
  • Region: SPEECH_REGION is required for synthesis and has no default. Dry-run mode does not need it.
  • Python 3.11+ with uv for virtual environment management.
  • Data handling note: Speaker-notes content is transmitted to the configured SPEECH_REGION for synthesis. For prebuilt neural voices, Microsoft states that neither the input text nor the output audio is stored in Microsoft logs; see Data, privacy, and security for text to speech. Operators must still set an approved region and avoid sending regulated or confidential narration.

Microsoft Entra ID Auth (Recommended)

Entra ID avoids storing a long-lived key. It requires a custom domain on the Speech resource and the Cognitive Services Speech User role for the signed-in identity. The script resolves the identity through DefaultAzureCredential, so an az login session, a managed identity, or a GitHub Actions OIDC login through azure/login all work.

export SPEECH_RESOURCE_ID="/subscriptions/.../Microsoft.CognitiveServices/accounts/your-resource"
export SPEECH_REGION="eastus"

Key-Based Auth

export SPEECH_KEY="your-speech-key"
export SPEECH_REGION="eastus"

When both SPEECH_KEY and SPEECH_RESOURCE_ID are set, the script warns and uses the key. Unset SPEECH_KEY to use Entra ID.

Install dependencies:

# run from this skill folder
uv sync

Quick Start

Verify SSML templates without generating audio:

uv run scripts/generate_voiceover.py --dry-run --content-dir path/to/content

Generate voice-over WAV files:

uv run scripts/generate_voiceover.py --content-dir path/to/content --output-dir voice-over

Embed audio into a PPTX deck:

uv run scripts/embed_audio.py --input deck.pptx --audio-dir voice-over --output deck-narrated.pptx

Parameters Reference

For different speakers, synthesize one voice's selected slides per invocation using repeated --slide <number> arguments. Only those canonical slide-NNN folders are read and their WAVs replaced; other speakers' outputs are untouched. Omit --slide to synthesize the whole deck.

generate_voiceover.py

ParameterTypeDefaultDescription
--dry-runflagfalsePrint SSML without generating audio
--voicestringen-US-Andrew:DragonHDLatestNeuralAzure AI Speech voice name
--ratestring+10%Speech prosody rate
--content-dirpathcontentPath to slide content directory
--output-dirpathvoice-overPath to WAV output directory
--slideintegerall slidesRepeat to synthesize only the selected canonical slide numbers
--lexiconpath(auto-detect)Custom acronyms.yaml path
--collapse-newlinesflagfalseCollapse newlines and whitespace runs in speaker notes into single spaces before synthesis
--verbose / -vflagfalseEnable verbose (DEBUG) logging output

embed_audio.py

Embeds WAV files into corresponding PPTX slides and adds narration timing XML so PowerPoint recognizes the audio for video export via File > Export > Create a Video > Use Recorded Timings and Narrations.

ParameterTypeDefaultDescription
--inputpath(required)Source PPTX file path
--audio-dirpathvoice-overDirectory with slide-NNN.wav
--outputpath*-narrated.pptxOutput PPTX file path
--verbose / -vflagfalseEnable verbose (DEBUG) logging output

Each WAV file maps to a slide by the number in its name, so slide-1.wav and slide-001.wav both map to slide 1. When two files map to the same slide, embedding stops with an error and writes no output. WAV files numbered past the last slide are ignored with a warning. An unreadable WAV file is reported, its slide is left unchanged, and the remaining slides are still embedded.

Script Reference

Generate with custom voice and rate:

uv run scripts/generate_voiceover.py \
  --content-dir content \
  --output-dir voice-over \
  --voice "en-US-Jenny:DragonHDLatestNeural" \
  --rate "+5%"

Use a custom lexicon:

uv run scripts/generate_voiceover.py \
  --content-dir content \
  --lexicon custom-acronyms.yaml

Collapse newlines in speaker notes (recommended for block-scalar | notes, whose line breaks are otherwise spoken as pauses):

uv run scripts/generate_voiceover.py \
  --content-dir content \
  --collapse-newlines

Embed generated audio:

uv run scripts/embed_audio.py \
  --input slide-deck/presentation.pptx \
  --audio-dir voice-over \
  --output slide-deck/presentation-narrated.pptx

Acronym Lexicon

The lexicon controls SSML <sub alias> replacements for acronyms and technical terms. Create an acronyms.yaml file:

acronyms:
  HVE-Core: "H V E Core"
  OWASP: "Oh wasp"
  SBOM: "S Bomb"
  SLSA: "Salsa"
  CI/CD: "C I C D"

Lexicon resolution order:

  1. Path specified via --lexicon argument.
  2. acronyms.yaml in the content directory.
  3. Built-in defaults covering common technical acronyms.

SSML Template

Each slide produces an SSML document:

<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
 xmlns:mstts="http://www.w3.org/2001/mstts" xml:lang="en-US">
  <voice name="en-US-Andrew:DragonHDLatestNeural">
    <prosody rate="+10%">
      Text with <sub alias="Oh wasp">OWASP</sub> aliases applied.
    </prosody>
  </voice>
</speak>

Integration with PowerPoint Skill

This skill reads from the PowerPoint skill's content directory structure:

content/
├── slide-001/
│   └── content.yaml    # Must include speaker_notes: field
├── slide-002/
│   └── content.yaml
└── ...

Each content.yaml should contain a speaker_notes: field with the narration text. The generated WAV files are named slide-NNN.wav matching the directory names.

Troubleshooting

IssueSolution
Set SPEECH_KEY ... or SPEECH_RESOURCE_IDExport SPEECH_KEY (key auth) or SPEECH_RESOURCE_ID (Entra ID) with SPEECH_REGION.
SPEECH_REGION must be setExport SPEECH_REGION with an approved Azure region. Synthesis has no default region.
Multiple WAV files map to slide NRemove the duplicate WAV files (for example slide-1.wav beside slide-001.wav) and rerun embed_audio.py.
401 with Entra ID authVerify custom domain on the Speech resource and Cognitive Services Speech User role. RBAC propagation takes up to 5 minutes.
Empty WAV files or skipped slidesVerify speaker_notes: is present and non-empty in content.yaml.
Mispronounced acronymsAdd entries to acronyms.yaml with phonetic aliases.
azure-cognitiveservices-speech package is requiredRun uv sync in the skill directory.
Audio icon visible in PPTXReposition or resize the audio object in PowerPoint after embedding.
Authored slide animations missing after embeddingembed_audio.py replaces existing p:timing with narration timing; re-apply animations in PowerPoint after embedding audio.
Slides no longer advance on click after embeddingembed_audio.py sets advClick="0" for auto-advance. To re-enable, select all slides in PowerPoint and check Advance Slide > On Mouse Click in the Transitions tab.
Video export shows "No timings recorded"Re-embed audio with the updated embed_audio.py which adds narration timing XML automatically.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

accessibility

Microsoft 官方免费

Consolidated accessibility skill entrypoint for WCAG 2.2, ARIA Authoring Practices, cognitive accessibility, Section 508, EN 301 549, design intent verification, and the Accessibility Planner workflow.

中文简介正在准备中。当前显示原文说明。

microsoft/hve-core15632026年10月22日 更新

accessibility-coverage-matrix

Microsoft 官方免费

Build, refresh, report, or probe an accessibility coverage matrix across criteria, surfaces, and evidence methods. Use when assessing coverage with the accessibility runtime harness and generated evidence bundle.

中文简介正在准备中。当前显示原文说明。

microsoft/hve-core15632026年10月22日 更新

adr-author

Microsoft 官方免费

Authoring skill for Architecture Decision Records (ADRs) supporting capture, from-planner-handoff, and adopt-template entry modes with selectable Y-Statement or MADR v4.0.0 output templates, supersession lineage, and ASR trigger evaluation.

中文简介正在准备中。当前显示原文说明。

microsoft/hve-core15632026年10月22日 更新

analysis-authoring

Microsoft 官方免费

Authoring conventions for exploratory data analysis notebooks and analytical dashboards, covering section sequence, visualization selection, scale thresholds, caching and state, and dashboard validation budgets. Use when composing or reviewing an EDA notebook, an analytical dashboard, or a dashboard test pass.

中文简介正在准备中。当前显示原文说明。

microsoft/hve-core15632026年10月22日 更新

architecture-diagrams

Microsoft 官方免费

Architecture diagram authoring for cloud infrastructure and declared data catalogs. Use when rendering Azure IaC or DS_CATALOG_V1 relationships as caller-selected ASCII or Mermaid diagrams.

中文简介正在准备中。当前显示原文说明。

microsoft/hve-core15632026年10月22日 更新

architecture-review

Microsoft 官方免费

Create a durable Architecture Review Record from a confirmed System Architecture Reviewer scope, evidence, pillar analysis, trade-offs, and dispositions

中文简介正在准备中。当前显示原文说明。

microsoft/hve-core15632026年10月22日 更新

查看 microsoft 的全部技能

报告此技能的问题