How-to

用 Gemini 技能包和无头 Chrome 测试语音功能

Why we picked it

没麦克风也能测语音功能,Schmid 这条模板教你用 tts 造测试音频,再让无头 Chrome 假装成麦克风播给它听。

Philipp Schmid 分享一条提示词模板,通过 npx skills add google-gemini/gemini-skills --skill gemini-api-cli 安装技能。流程核心是用 gemini-api tts 生成 WAV 语音测试文件。再用无头 Chrome 的 --use-fake-device-for-media-stream 参数把该 WAV 文件喂给 getUserMedia,模拟麦克风输入。这样无需物理麦克风即可端到端验证应用的语音采集功能。

Original · Philipp Schmid

Example prompt template: Install npx skills add google-gemini/gemini-skills --skill gemini-api-cli -y and test the voice or audio feature in this project end-to-end without a physical mic. Find how the app opens microphone capture, generate spoken WAV test files with gemini-api tts, and launch headless Chrome with --use-fake-ui-for-media-stream --use-fake-device-for-media-stream --use-file-for-fake-audio-capture=/abs/path/voice.wav%noloop. Click the mic button so getUserMedia streams the WAV from 0.0s and verify the feature works. 💬 1 🔄 0 ❤️ 1 👀 322 📊 1 ⚡