Rust push-to-talk voice bridge for pasting ASR output into the foreground app. The bridge has two first-class ASR providers:
doubao: Doubao streaming ASR over WebSocket.mai: MAI through Azure Speech REST transcription or Voice Live WebSocket transcription.
Doubao remains the default provider. MAI is selected explicitly with --asr-provider mai.
Configure credentials for the provider you want to use:
cargo run --bin configure_credentials -- --provider doubao
cargo run --bin configure_credentials -- --provider maiList input devices:
cargo run --bin voice_bridge -- --mic-list-devicesRun the push-to-talk bridge:
cargo run --bin voice_bridge -- --asr-provider doubao
cargo run --bin voice_bridge -- --asr-provider mai --mai-model mai-transcribe-1.5
cargo run --bin voice_bridge -- --asr-provider mai --mai-transport voice-live --mai-model mai-transcribe-1Run one-shot file demos:
cargo run --bin doubao_asr_demo -- --audio-file .\audio.pcm --audio-format pcm
cargo run --bin mai_demo -- --audio-file .\audio.wav --model mai-transcribe-1.5Use the provider docs for account setup, credential formats, and provider-specific ASR options:
Credential files are intentionally separate:
doubao_credentials.json
mai_credentials.json
Both files are ignored by git. Only the *.example.json templates should be committed.
--asr-provider doubao|mai: choose the ASR provider.--ptt-key <key>: push-to-talk key. Defaults tocapslock.--mic-device <selector>: microphone device index or name substring.--mic-duration <seconds>: maximum recording duration for one utterance. Defaults to60.--preview-mode single|line|off: interim text preview mode.--submit: press Enter after pasting the final text.--output-json <path>: write per-utterance JSON results.
Provider-specific options keep their provider prefix where needed:
- Doubao:
--resource-id,--ws-url,--asr-hotword,--asr-corpus-context,--asr-auto-context. - MAI:
--mai-transport,--mai-model,--mai-locale,--mai-style,--mai-phrase,--mai-credentials.
voice_bridgeusesdoubaounless--asr-provider maiis passed.voice_bridgeenables Doubaoenable_nonstreamby default.- Windows default PTT key:
capslock. - macOS default PTT key:
capslock. - Windows supports
space,enter,capslock,left-win,right-control,right-shift,f1throughf12, or a single letter as the PTT key. - macOS also supports
fn; whenfnis used for PTT, Fn/Globe shortcuts andfn+...key combinations are unavailable while the bridge is running.
Windows:
powershell -ExecutionPolicy Bypass -File .\packaging\build_windows_release.ps1macOS:
bash ./packaging/check_macos_ready.sh
bash ./packaging/build_macos_release.shRelease bundles include the binaries, credential templates, launch scripts, and the docs/ folder.
src/: Rust source.docs/providers/: provider-specific setup and behavior notes.docs/diagnostics/: runtime review notes.packaging/: release bundle scripts and release README files.doubao_credentials.example.json: blank Doubao credentials template.mai_credentials.example.json: blank MAI credentials template.
Do not commit real credentials. Keep these files local:
doubao_credentials.json
mai_credentials.json
Generated output and build artifacts are ignored:
outputs/
target/
packaging/release/