twin_stream 0.2.0
twin_stream: ^0.2.0 copied to clipboard
Simultaneous speech-to-text and audio file recording in a single API. Solves the Android microphone lock issue that prevents using recording and speech recognition at the same time.
0.2.0 #
- 🧠 True Android Simultaneous STT Support: Added
voskModelPathtoTwinStreamConfig. When provided, the package leveragesvosk_flutterand a custom raw PCM stream-to-WAV writer to fully bypass the Android OS Microphone Lock, allowing true simultaneous recording and offline transcription on strict devices. - 🐛 Bug Fix: Addressed Issue #1 by clearing non-fatal STT timeout errors (such as
error_speech_timeout) immediately after they are emitted, preventing the duration timer from rebroadcasting the same error to the UI continuously on fallback.
0.1.0 #
- 🎉 Initial release of
twin_stream - Simultaneous speech-to-text and audio file recording in a single API
- Android: Automatic microphone lock fallback (simultaneous → sequential)
- iOS / macOS: True simultaneous recording and speech recognition
TwinStreamController— main API withstart(),stop(),cancel(),pause(),resume()TwinStreamConfig— configurable sample rate, encoder, locale, Android strategyTwinStreamState— real-time state stream with live transcript, sound level, recording durationTwinStreamResult— session results with audio file path, transcript, confidence, alternates- Custom exception hierarchy:
TwinStreamPermissionException,TwinStreamMicrophoneLockException,TwinStreamInitializationException,TwinStreamRecordingException - Three Android recording strategies:
simultaneousWithFallback,sequential,simultaneousStrict - Support for multiple audio encoders: WAV, AAC, Opus, FLAC, PCM
- Comprehensive documentation and example app