음성에서 텍스트로의 처리에 대한 세밀한 제어를 제공하는 플러터 패키지로, 말의 정지 시에도 자동으로 중단되지 않고 지속적인 오디오 캡처가 가능합니다. 개발자는 사용자 정의 콜백을 사용하여 인식을 수동으로 시작, 일시정지, 재개 및 중지할 수 있으며, 끊김 없는 전사가 필요한 애플리케이션에 이상적입니다. 음성 보조기, 실시간 사전 입력 도구, 그리고 원활한 오디오 입력이 중요한 상호작용 앱에 적합합니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 다양한 플랫폼을 지원합니다.
사용 사례
실시간 음성 입력
음성 제어 애플리케이션
지속적인 전사 워크플로우
인터랙티브 음성 인터페이스
음성 기반 데이터 입력
사용자 정의 가능한 음성 보조 로직
주요 기능
수동 시작/일시정지/재개/정지 컨트롤
발화 중단 기간 동안 자동 일시정지 없음
사용자 정의 콜백 처리
지속적인 듣기 모드
크로스 플랫폼 지원 (Android, iOS, Web, macOS, Windows, Linux)
세밀한 오디오 스트림 관리
적합한 대상
STT 프로세스에 대한 완전한 제어가 필요한 개발자
끊김 없는 음성 인식이 필요한 애플리케이션
음성 보조자 빌더
장문 음성 입력을 위한 도구
사용자 정의 음성 상호작용 로직을 가진 앱
고려 사항
수동 상태 관리가 필요합니다
자동 일시정지 STT 패키지보다 더 높은 복잡성
에지 케이스를 처리하기 위해 추가적인 오류 처리가 필요할 수 있습니다
플랫폼별 음성 API에 의존합니다
간단한 한 번의 전사에 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
manual_speech_to_text
A Flutter plugin that enhances the standard speech-to-text functionality by providing manual control over speech recognition, including pause and resume capabilities, and improved continuous listening. This package addresses common issues like automatic stopping during silence and lack of manual control in the standard speech-to-text implementation.
Add the following permission to your Android Manifest (android/app/src/main/AndroidManifest.xml):
<uses-permissionandroid:name="android.permission.RECORD_AUDIO"/><uses-permissionandroid:name="android.permission.INTERNET"/><uses-permissionandroid:name="android.permission.BLUETOOTH"/><uses-permissionandroid:name="android.permission.BLUETOOTH_ADMIN"/><uses-permissionandroid:name="android.permission.BLUETOOTH_CONNECT"/><!-- other tags --><queries><intent><actionandroid:name="android.speech.RecognitionService" /></intent></queries>
The main controller class for managing speech recognition.
Methods
listen({required onListeningStateChanged, required onListeningTextChanged, onSoundLevelChanged}): Set up callbacks for state changes, text recognition, and sound level monitoring
startStt(): Start speech recognition
stopStt(): Stop speech recognition
pauseStt(): Pause speech recognition
resumeStt(): Resume paused speech recognition
dispose(): Clean up resources
Properties
enableHapticFeedback: Enable/disable haptic feedback during recognition
localId: Set the locale for speech recognition (e.g., 'en-US')
Ensure your Android Manifest (android/app/src/main/AndroidManifest.xml) includes:
<uses-permissionandroid:name="android.permission.RECORD_AUDIO"/><uses-permissionandroid:name="android.permission.INTERNET"/><uses-permissionandroid:name="android.permission.BLUETOOTH"/><uses-permissionandroid:name="android.permission.BLUETOOTH_ADMIN"/><uses-permissionandroid:name="android.permission.BLUETOOTH_CONNECT"/><!-- other tags --><queries><intent><actionandroid:name="android.speech.RecognitionService" /></intent></queries>
Best Practices
Resource Management
// Proper disposal in StatefulWidget@overridevoiddispose() {
controller.dispose();
super.dispose();
}
Requires Google Play Services for speech recognition
Works offline for some languages (device-dependent)
iOS (Coming Soon)
Troubleshooting
Common Issues
Microphone Permission
Ensure you've added the RECORD_AUDIO permission in AndroidManifest.xml
Ensure you've added <action android:name="android.speech.RecognitionService" /> tag in AndroidManifest.xml between proper tags
The package handles permission requests, but you might need to handle denied permissions in your app
Recognition Stops Unexpectedly
Check if the device is online
Verify that the locale is properly set
Ensure the app has proper permissions
Recognition Quality Issues
Ensure proper microphone proximity
Check for background noise interference
Verify language settings match spoken language
Performance Optimization
Consider enabling haptic feedback for better user experience
Implement error handling for network connectivity issues
Clear disposed controllers to prevent memory leaks
Beef Sound
On some devices, a beep sound is heard:
At the start (after calling the startStt method).
At the end of the conversation (after calling stopStt or pauseStt methods).
During silence (if the user doesn’t speak for a certain duration, typically around 5 seconds on iOS and 2–3 seconds on Android).
Unfortunately, this behavior is platform-dependent and cannot be overridden.
As per the standard plugin documentation, this is a known limitation and cannot be customized.
Note:
For initial setup, if you need more information, please follow the instructions from the documentation of standard speech_to_text.
If you encounter any challenges or need additional troubleshooting help, don't forget to refer to the standard speech_to_text package for more insights and best practices.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Credits
This package builds upon the speech_to_text package, adding manual control and continuous listening capabilities.