Note: This is a fork of r0227n/flutter_whisper_kit with fixes for iOS/macOS platform compatibility.
A monorepo for Flutter WhisperKit packages that enable on-device speech recognition in Flutter applications using WhisperKit.
This fork includes the following improvements over the original:
The original podspec had a bug where setting s.platform twice would cause the second platform declaration to override the first, breaking multi-platform support. This fork fixes the issue by using platform-specific deployment targets and dependencies:
# Fixed: Support both iOS and macOS platforms
s.ios.deployment_target = '16.0'
s.osx.deployment_target = '13.0'
# Platform-specific dependencies
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'Fixed progress stream conflicts during simultaneous downloads. The Progress model now includes an optional variant field that identifies which model the progress event belongs to, allowing clients to filter progress by variant when downloading multiple models concurrently:
// Progress events now include the variant
modelProgressStream.listen((progress) {
if (progress.variant == 'openai_whisper-large-v3') {
// Handle progress for this specific model
}
});The task parameter in DecodingOptions is now properly respected. You can control whether WhisperKit transcribes audio in the original language or translates it to English:
// Transcribe in original language (default)
await transcribeFromFile(path, options: DecodingOptions(
task: DecodingTask.transcribe,
language: 'de', // German
));
// Translate to English
await transcribeFromFile(path, options: DecodingOptions(
task: DecodingTask.translate,
language: 'de', // German audio, English output
));Flutter WhisperKit is a wrapper package that enables the use of WhisperKit within Flutter applications. WhisperKit is an on-device speech recognition framework developed by Argmax that provides high-quality transcription capabilities.
This repository is organized as a monorepo containing the following packages:
- flutter_whisper_kit: The main package that provides a platform-agnostic API for using WhisperKit in Flutter applications.
- flutter_whisper_kit_apple: The platform implementation for Apple devices (iOS and macOS).
- On-device speech recognition with no data sent to external servers
- Support for multiple model sizes (tiny to large)
- File-based audio transcription
- Real-time microphone transcription
- Configurable model storage options
- Progress tracking for model downloads
streaming_transcription.mov
To use Flutter WhisperKit in your Flutter application, add the following dependency to your pubspec.yaml:
dependencies:
flutter_whisper_kit: latestFor detailed usage instructions, refer to the documentation in the individual package directories:
- Original flutter_whisper_kit - The original Flutter WhisperKit implementation by r0227n
- WhisperKit - The underlying speech recognition framework by Argmax
- Flutter - The UI toolkit for building natively compiled applications
This project is licensed under the MIT License - see the LICENSE file for details.