How const-me/whisper works
Whisper is a Windows speech-recognition library and application-facing API port of whisper.cpp. The main workflow loads a Whisper model, accepts audio from a file, stream, or microphone, converts it to model input, runs encoder/decoder inference, and exposes transcription results. The README also documents DirectCompute acceleration, voice-activity detection, profiling, a C# wrapper, and PowerShell scripting. The graph reflects those documented capabilities; sampled excerpts confirm key API, inference, and tensor-compute behavior, but do not expose every subsystem’s wiring.
Main entry points: ContextImpl.cpp Transcription context · iContext.cl.h COM-style API · Context.cs C# wrapper · AudioCapture.cpp Microphone capture
Components 20
API and clients
- COM-style API
Whisper/API/iContext.cl.h - C# wrapper
WhisperNet/Context.cs - PowerShell commands
WhisperPS/Commands/TranscribeFile.cs
Audio and speech
- File audio
Whisper/MF/loadAudioFile.cpp - Audio stream
Whisper/MF/PcmReader.cpp - Microphone capture
Whisper/MF/AudioCapture.cpp - Voice activity detection
Whisper/Whisper/voiceActivityDetection.h - Mel spectrogram
Whisper/Whisper/melSpectrogram.cpp
Model inference
- Model loading
Whisper/modelFactory.cpp - Transcription context
Whisper/Whisper/ContextImpl.cpp - Transcription results
Whisper/Whisper/TranscribeResult.h
Compute and diagnostics
- DirectCompute backend
Whisper/Whisper/WhisperContext.cpp - GPU tensor operations
Whisper/ML/MlContext.cpp - D3D shader dispatch
Whisper/D3D/shaders.cpp - CPU compute
Whisper/CPU/MlContextCpu.cpp - Hybrid inference
Whisper/Hybrid/HybridContext.cpp - Performance profiler
Whisper/Utils/ProfileCollection.cpp
Other components
- Application / user
- Microphone
- Audio file
Connections 21
- Application / user → C# wrapper: calls
- Application / user → PowerShell commands: runs
- C# wrapper → COM-style API: calls
- PowerShell commands → COM-style API: uses
- COM-style API → Model loading: loads model
- COM-style API → Transcription context: creates context
- Audio file → File audio: supplies audio
- Microphone → Microphone capture: supplies audio
- File audio → Transcription context: provides audio
- Audio stream → Transcription context: provides audio
- Microphone capture → Transcription context: provides audio
- Microphone capture → Voice activity detection: processes audio
- Transcription context → Mel spectrogram: creates features
- Transcription context → DirectCompute backend: runs inference
- DirectCompute backend → GPU tensor operations: uses tensor ops
- GPU tensor operations → D3D shader dispatch: dispatches shaders
- Transcription context → Transcription results: produces
- C# wrapper → Transcription results: exposes
- DirectCompute backend → Performance profiler: records timings
- Transcription context → CPU compute: uses CPU ops
- Transcription context → Hybrid inference: uses hybrid mode