FieldCure.DocumentParsers.Audio
0.2.0
See the version list below for details.
dotnet add package FieldCure.DocumentParsers.Audio --version 0.2.0
NuGet\Install-Package FieldCure.DocumentParsers.Audio -Version 0.2.0
<PackageReference Include="FieldCure.DocumentParsers.Audio" Version="0.2.0" />
<PackageVersion Include="FieldCure.DocumentParsers.Audio" Version="0.2.0" />
<PackageReference Include="FieldCure.DocumentParsers.Audio" />
paket add FieldCure.DocumentParsers.Audio --version 0.2.0
#r "nuget: FieldCure.DocumentParsers.Audio, 0.2.0"
#:package FieldCure.DocumentParsers.Audio@0.2.0
#addin nuget:?package=FieldCure.DocumentParsers.Audio&version=0.2.0
#tool nuget:?package=FieldCure.DocumentParsers.Audio&version=0.2.0
FieldCure.DocumentParsers.Audio
Audio transcription support for FieldCure.DocumentParsers.
This package adds an IDocumentParser for .mp3, .wav, .m4a, .ogg,
.flac, and .webm files. Audio is converted to 16 kHz mono PCM WAV with
NAudio, then transcribed with Whisper.net into timestamped Markdown for RAG
pipelines.
Install
dotnet add package FieldCure.DocumentParsers.Audio
Usage
using FieldCure.DocumentParsers;
using FieldCure.DocumentParsers.Audio;
await using var transcriber = DocumentParserFactoryAudioExtensions.AddAudioSupport();
var parser = DocumentParserFactory.GetParser(".mp3")!;
var markdown = parser.ExtractText(File.ReadAllBytes("meeting.mp3"));
For explicit options, instantiate AudioDocumentParser directly:
var parser = new AudioDocumentParser();
var markdown = parser.ExtractText(
File.ReadAllBytes("meeting.m4a"),
new AudioExtractionOptions
{
SourceExtension = ".m4a",
Language = "ko",
ModelSize = WhisperModelSize.Base,
IncludeTimestamps = true
});
Set ModelPath to use a pre-downloaded ggml model. Otherwise the default model
provider downloads the selected model from Hugging Face on first use and caches
it under {UserProfile}/.fieldcure/whisper-models/.
Lifecycle
WhisperTranscriber caches the underlying WhisperFactory for the model path
in use, so it holds native resources for as long as it lives. Dispose it once at
application shutdown:
// Startup
var transcriber = DocumentParserFactoryAudioExtensions.AddAudioSupport();
// Shutdown
await transcriber.DisposeAsync();
When you construct AudioDocumentParser() with no arguments it owns its
transcriber, and await using on the parser disposes it for you.
Runtime selection (CUDA / Vulkan / CPU)
Whisper.net resolves the native runtime through process-global state
(Whisper.net.LibraryLoader.RuntimeOptions.RuntimeLibraryOrder). To override
the default CUDA → Vulkan → CPU order, set it once at startup rather than
per call:
using Whisper.net.LibraryLoader;
// App startup
RuntimeOptions.RuntimeLibraryOrder = [RuntimeLibrary.Cpu];
AudioExtractionOptions.RuntimeLibraryOrder writes to the same global, which
is convenient for one-off configuration but is last-writer-wins under
concurrent calls.
Notes
- The package is Windows-only in v0.1.0 because audio decoding uses NAudio's Media Foundation path for several containers.
- The ggml model is downloaded at runtime; it is not included in the NuGet package.
- For tests or cloud transcription, inject a custom
IAudioTranscriber.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FieldCure.DocumentParsers (>= 2.0.1)
- NAudio (>= 2.2.1)
- NAudio.Vorbis (>= 1.5.0)
- Whisper.net (>= 1.9.0)
- Whisper.net.Runtime (>= 1.9.0)
- Whisper.net.Runtime.Cuda (>= 1.9.0)
- Whisper.net.Runtime.Vulkan (>= 1.9.0)
-
net8.0
- FieldCure.DocumentParsers (>= 2.0.1)
- NAudio (>= 2.2.1)
- NAudio.Vorbis (>= 1.5.0)
- Whisper.net (>= 1.9.0)
- Whisper.net.Runtime (>= 1.9.0)
- Whisper.net.Runtime.Cuda (>= 1.9.0)
- Whisper.net.Runtime.Vulkan (>= 1.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v0.2.0 - Adds WhisperEnvironment for environment-aware Whisper model size recommendation (Tiny→Large) based on detected GPU/RAM/cores, plus AudioExtractionOptions.WithModelSize for partial overrides. No breaking changes.