👉 Try the demo: https://github.com/LM-Kit/lm-kit-net-samples/tree/main/console_net/speech/audio-language-detection/language_detect_then_transcribe
Audio Language Detection for C# .NET Applications
🎯 Purpose of the Demo
Calls SpeechToText.DetectLanguage(audio) on one or more audio files and prints the detected ISO language code with confidence. Optionally chains into Transcribe(audio, detectedLanguage) so the transcription quality benefits from the pinned language.
👥 Who Should Use This Demo
- Multilingual call centres, transcription services, customer support tooling.
- Anyone routing audio to language-specific downstream pipelines.
🚀 What Problem It Solves
Running Whisper in "auto" is slower and less accurate than running it with the language pinned. A 200 ms language probe + pinned transcription beats a single "auto" pass on both metrics.
✨ Key Features
SpeechToText.DetectLanguage(WaveFile)returnsLanguageDetectionResult { Language, Confidence }.SpeechToText.GetSupportedLanguages()enumerates what the loaded Whisper model recognises.SpeechToText.Transcribe(audio, language)accepts a pinned ISO code.
⚙️ Getting Started
cd lm-kit-net-samples/console_net/speech/audio-language-detection/language_detect_then_transcribe
dotnet run -- "C:\calls\fr-call.mp3" "C:\calls\de-call.wav"