mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-25 04:29:51 +01:00
- device_simulator.py: audio E2E engine (mic capture -> Opus 60ms frames, downlink decode/playback), half-duplex mutex, digital injection of corpus wavs, headless scenarios (baseline/swallowhunt/zombie/idle incl. half-open connection reproduction), JSONL event log and uplink/downlink PCM dumps - device_simulator_tui.py: Textual TUI front-end with full per-turn transcript, L1-L5 latency panel, WS ping probe and key bindings (wake/interrupt/mic/probe/corpus injection/volume) - phrases.txt + prewarm_corpus.py + speak.ps1: corpus and local synthesis (edge-tts with Windows SAPI fallback) - docs/device-simulator-tui.md (bilingual) + cross references in device-protocol-simulator.md and performance_tester.md
8 lines
476 B
PowerShell
8 lines
476 B
PowerShell
param([Parameter(Mandatory=$true)][string]$Text, [Parameter(Mandatory=$true)][string]$Out)
|
|
Add-Type -AssemblyName System.Speech
|
|
$s = New-Object System.Speech.Synthesis.SpeechSynthesizer
|
|
$s.SetOutputToWaveFile($Out, (New-Object System.Speech.AudioFormat.SpeechAudioFormatInfo(16000, [System.Speech.AudioFormat.AudioBitsPerSample]::Sixteen, [System.Speech.AudioFormat.AudioChannel]::Mono)))
|
|
$s.Rate = 0
|
|
$s.Speak($Text)
|
|
$s.Dispose()
|
|
Write-Output ("OK " + (Get-Item $Out).Length)
|