![]() |
VOOZH | about |
dotnet add package NLayer --version 1.16.0
NuGet\Install-Package NLayer -Version 1.16.0
<PackageReference Include="NLayer" Version="1.16.0" />
<PackageVersion Include="NLayer" Version="1.16.0" />Directory.Packages.props
<PackageReference Include="NLayer" />Project file
paket add NLayer --version 1.16.0
#r "nuget: NLayer, 1.16.0"
#:package NLayer@1.16.0
#addin nuget:?package=NLayer&version=1.16.0Install as a Cake Addin
#tool nuget:?package=NLayer&version=1.16.0Install as a Cake Tool
NLayer is a fully managed MP3 to WAV decoder. The code was originally based on JavaLayer (v1.0.1), which has been ported to C#.
Was previously hosted at nlayer.codeplex.com. Please see the history there for full details of contributors.
To use NLayer for decoding MP3, first reference NLayer.
using NLayer;
Then create an MpegFile, pass a file name or a stream to the constructor, and use ReadSamples for decoding the content:
// samples per second times channel count
const int samplesCount = 44100;
var fileName = "myMp3File.mp3";
var mpegFile = new MpegFile(filename);
float[] samples = new float[samplesCount];
int readCount = mpegFile.ReadSamples(samples, 0, samplesCount);
More information could be found in code documents.
NLayer is capable of using in conjunction with NAudio for file conversion and real-time playback.
You need to reference NAudio, NLayer and NLayer.NAudioSupport first.
using NAudio.Wave;
using NLayer.NAudioSupport;
Then create an Mp3FileReader, passing in a FrameDecompressorBuilder that uses the Mp3FrameDecompressor from NLayer.NAudioSupport:
var fileName = "myMp3File.mp3";
var builder = new Mp3FileReader.FrameDecompressorBuilder(wf => new Mp3FrameDecompressor(wf));
var reader = new Mp3FileReaderBase(fileName, builder);
// play or process the file, e.g.:
waveOut.Init(reader);
waveOut.Play();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 netcoreapp1.0 was computed. netcoreapp1.1 netcoreapp1.1 was computed. netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard1.3 netstandard1.3 is compatible. netstandard1.4 netstandard1.4 was computed. netstandard1.5 netstandard1.5 was computed. netstandard1.6 netstandard1.6 was computed. netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net46 net46 was computed. net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen30 tizen30 was computed. tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Universal Windows Platform | uap uap was computed. uap10.0 uap10.0 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on NLayer:
| Package | Downloads |
|---|---|
|
NLayer.NAudioSupport
NAudio support for NLayer |
|
|
HPD-Agent.Framework
A middleware-driven agentic AI framework built on Microsoft.Extensions.AI for building intelligent, tool-using agents. |
|
|
YellowDogMan.CSCoreFork
Fork of CSCore by filoe |
|
|
Aural
A cross-platform audio playback library for WAV, OGG, and MP3 formats with real-time audio filters (low-pass, high-pass, reverb, pitch shift). Play audio with a single line of code |
|
|
Blitter
Blitter - a .NET graphics library. Class wrappers around SDL3 for graphics, input, audio, and more. Bundles the core Blitter library, SkiaSharp-powered image loading and Skia rendering helpers, and the Blitter.Blocks2D / Blitter.Blocks3D scene layers. |
Showing the top 5 popular GitHub repositories that depend on NLayer:
| Repository | Stars |
|---|---|
|
ValveResourceFormat/ValveResourceFormat
Source 2 Viewer is an all-in-one tool to browse VPK archives, view, extract, and decompile Source 2 assets, including maps, models, materials, textures, sounds, and more.
|
|
|
Pyrdacor/Ambermoon.net
Ambermoon rewrite in C#
|
|
|
leezer3/OpenBVE
OpenBVE- A free train simulator
|
|
| bernatvadell/muonline | |
|
zhongkaifu/TensorSharp
A C# inference engine for running large language models (LLMs) locally using GGUF model files. TensorSharp provides a console application, a web-based chatbot interface, and Ollama/OpenAI-compatible HTTP APIs for programmatic access. It supports Windows/MacOS/Linux with full GPU capability
|