Spek.NET
0.2.0
See the version list below for details.
dotnet add package Spek.NET --version 0.2.0
NuGet\Install-Package Spek.NET -Version 0.2.0
<PackageReference Include="Spek.NET" Version="0.2.0" />
<PackageVersion Include="Spek.NET" Version="0.2.0" />
<PackageReference Include="Spek.NET" />
paket add Spek.NET --version 0.2.0
#r "nuget: Spek.NET, 0.2.0"
#:package Spek.NET@0.2.0
#addin nuget:?package=Spek.NET&version=0.2.0
#tool nuget:?package=Spek.NET&version=0.2.0
Spek.NET
Spek.NET turns an audio file into a spectrogram the way Spek does, with Spek's palettes, window functions, dB scale and rulers. It has no UI. For a WinUI 3 control that draws the result, use Spek.NET.WinUI.
Spek.NET decodes with ffmpeg.exe, which it runs as a separate process. The package doesn't include ffmpeg.
using Spek.Net;
var ffmpeg = new Ffmpeg(Ffmpeg.Find([]) ?? throw new FileNotFoundException("ffmpeg isn't on PATH."));
var info = await ffmpeg.ProbeAsync(@"C:\Music\song.flac");
if (info.Error != AudioError.None) throw new InvalidOperationException(SpekDescription.ErrorText(info.Error));
var settings = new AnalysisSettings(Channel: 0, FftBits: 11, WindowFunction: WindowFunction.Hann);
var spectrogram = new Spectrogram(800, SpekDefaults.BinsFor(settings.FftBits), Palette.Spectrum, lowerDb: -120, upperDb: 0);
await SpekAnalyzer.AnalyzeAsync(ffmpeg, info, settings, spectrogram);
// spectrogram.Pixels holds 800 x 1025 BGRA pixels, with the highest frequency in the top row.
// spectrogram.GetValue(x, bin) is the level of one bin in dB.
Ffmpeg.ProbeAsyncreads the streams, sample rate, channels, bit depth, bitrate and duration from ffmpeg's output.SpekAnalyzer.AnalyzeAsyncdecodes one channel of one stream and fills theSpectrogramcolumn by column, so a UI can draw it while it runs. Cancelling the token stops ffmpeg.Spectrogram.SetRangeAndPaletterecolours without analysing again.SpectrogramPipelineis the column maths on its own, for samples from another decoder.SpekDescriptionandRulergive Spek's description line and ruler ticks.Spectrogram.GetProfile(firstColumn, endColumn, sampleRate)measures a selected passage's spectrum.SpectrumProfile.FindDrop()returns an optional measured spectral drop, not an estimate of the original codec or bitrate. A deliberately low-pass-filtered master can produce the same result.FrequencyRangeandTimeRangehandle coordinates and anchored zoom.EncoderReferences.Mp3Lamelists nominal LAME stereo CBR low-pass targets as optional inspection guides, not universal MP3 boundaries.SpekAnalyzer.AnalyzeRangeAsyncfills a separate spectrogram for an absolute time interval. It seeks with ffmpeg, decodes preceding audio for the first FFT's context, and excludes that context from the target's time interval.Ffmpeg.DecodeRangeAsyncexposes the bounded PCM decode. Cancellation stops the child process.
Licensed under GPL-3.0, like Spek. Source: https://github.com/DerekYang2/FluentSpek
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Spek.NET:
| Package | Downloads |
|---|---|
|
Spek.NET.WinUI
A WinUI 3 control that draws Spek's spectrogram of an audio file with Win2D as it decodes, and saves it as a PNG. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.3.0-preview.1 | 209 | 10/17/2026 |
| 0.2.0 | 136 | 10/17/2026 |
| 0.1.0 | 118 | 10/15/2026 |