Advanced Features
Waveform Generation
Every Probe call that decodes audio (WAV, FLAC, MP3, AAC, WMA — not MOV/MP4) populates ProbeResult.Waveform with a list of normalized peak values in [0, 1], one per window, via WaveformCalculator:
using EggEncoder.Waveform;
var calculator = new WaveformCalculator(totalSamplesPerChannel, channels, bitsPerSample);
int framesRead;
while ((framesRead = wavReader.ReadInterleavedSamples(buffer, 4096)) > 0)
{
calculator.AddBlock(new ReadOnlySpan<int>(buffer, 0, framesRead * channels));
}
List<double> windows = calculator.GetNormalizedWindows(); // default 200 windows
WaveformCalculator streams — call AddBlock as many times as you like across however many decode callbacks the codec produces; it does not need the full signal in memory at once.
Sample-Accurate Cutting
NativeEncoder.CutFile (backed by AudioCutter.Cut) decodes any supported source (WAV, FLAC, MP3, AAC, WMA) and writes any supported destination format (WAV, FLAC, MP3, AAC, WMA) without re-encoding the untouched region where the format allows frame-boundary slicing:
using EggEncoder.Codecs;
bool produced = AudioCutter.Cut(sourcePath, destPath, startInSeconds: 30, endInSeconds: 90);
// false means the requested range was entirely outside the source's duration — no file was written
Source and destination extensions no longer need to match — Cut can transcode while it trims (e.g. cut a WAV directly to MP3). Use AudioCutter.Convert (or NativeEncoder.ConvertFile) when you just need format conversion with no trimming.
MOV/MP4 Probing
MovProbe walks the ISO base media container's atom tree directly — no native dependency — to read duration, dimensions, and the video codec's four-character code:
using EggEncoder.Codecs.Mov;
var result = MovProbe.Probe("clip.mp4");
Console.WriteLine($"{result.Width}x{result.Height}, {result.DurationInSeconds}s, {result.CodecFourCc}");
This is metadata-only — MovProbe does not decode audio or video frames. NativeEncoder.Probe routes .mov/.mp4 files here automatically and leaves ProbeResult.Waveform null.
Native Binary Packaging
libmp3lame.dll and libFLAC.dll are packed via the NuGet contentFiles convention so they land at Native/win-x64/*.dll relative to your application's output directory — exactly where NativeLibraryLoader's custom DllImportResolver looks for them at runtime, regardless of your app's working directory. No manual copy step is required after dotnet add package EggEncoder.
These binaries are Windows x64 only. EggEncoder does not run on Linux/macOS or non-x64 architectures — there is no cross-platform fallback engine.