feat: Add Whisper STT Extension using faster-whisper #1984
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a Whisper STT (Speech-to-Text) extension for the TEN Framework using the faster-whisper library.
Closes #1969
Features
AsyncASRBaseExtensionfollowing TEN Framework patternsImplementation Details
Architecture
WhisperSTTExtension- Main ASR extension classWhisperClient- Handles faster-whisper model and inferenceWhisperSTTConfig- Pass-through params design for flexibilityFiles Added (14 files, 1,324 lines)
whisper_stt_python/extension.py- Main extension implementationwhisper_stt_python/whisper_client.py- Faster-whisper client wrapperwhisper_stt_python/config.py- Configuration managementwhisper_stt_python/reconnect_manager.py- Auto-reconnection logicwhisper_stt_python/addon.py- Extension entry pointwhisper_stt_python/const.py- Constantswhisper_stt_python/manifest.json- Extension metadatawhisper_stt_python/property.json- Default configurationwhisper_stt_python/requirements.txt- Dependencieswhisper_stt_python/README.md- Comprehensive documentationwhisper_stt_python/tests/test_config.py- Config tests (10 tests)whisper_stt_python/tests/test_extension.py- Extension tests (15 tests)Testing
Configuration Example
{ "params": { "model": "base", "device": "cpu", "compute_type": "int8", "language": "en", "task": "transcribe", "sample_rate": 16000 } }