How argmaxinc/whisperkit works
Overall Project Structure
• The Core Framework (Sources/WhisperKit)
• The Command Line Interface (Sources/WhisperKitCLI)
• Integration/Example Applications (the Examples/WhisperAX Xcode project and companion Watch App)
• CI/CD & Deployment Automation (GitHub workflows, fastlane scripts)
• Testing & Benchmarks (Tests directory and BENCHMARKS.md)
Main Components
a. WhisperKit Core:
• It as a central module that is further subdivided into functional areas:
• Audio Processing: Components like AudioChunker, AudioProcessor, AudioStreamTranscriber, EnergyVAD, and VoiceActivityDetector.
• Text Processing: Modules such as LogitsFilter, SegmentSeeker, TokenSampler, TextDecoder, and TranscribeTask.
• Utility Functions: Concurrency and other helper utilities found in the Utils directory.
• Configuration and Model Management: Files like Configurations.swift and Model selection logic.
b. WhisperKit CLI:
• That it leverages the WhisperKit Core APIs to offer command-line transcription capabilities.
• Command-line inputs (parameters like model-path, audio-path, streaming flag) that direct execution to the CLI.
c. Clients & Example Applications:
• A node representing the example apps (e.g., WhisperAX for iOS and the Watch App). This illustrates how developers integrate the framework into front-end applications.
• That these examples use the core functionality (typically via Swift Package Manager integration) and showcase real-time processing, UI views, and configuration files (like .xcconfig and Info.plist).
d. External Dependencies and Model Management:
e. CI/CD and Quality Assurance:
• CI/CD components (GitHub workflows, fastlane) as supporting systems that automatically run unit tests, pre-release tests, and update processes.
• This illustrates continuous integration and automated build/distribution practices that help maintain code quality and simplify deployments.
Architectural Patterns & Design Principles
• That WhisperKit uses modularization and separation of concerns: different directories handle audio logic, text logic, utilities, and configuration.
• Asynchronous programming patterns (for example, use of Swift’s async/await APIs) which are central in handling real-time streaming and processing.
• That dependency injection is likely used to allow testing and flexibility in model selection.
Technologies and Tools
• Clearly label components with their respective roles:
• Swift Package Manager for dependency management.
• Xcode for development and integration (as demonstrated by the Examples folder).
• GitHub Workflows and fastlane for building and testing.
• External tools like git-lfs (for model downloads) and Homebrew (for CLI installation) should also be mentioned.