NLayer 1.16.0

dotnet add package NLayer --version 1.16.0                
NuGet\Install-Package NLayer -Version 1.16.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NLayer" Version="1.16.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NLayer --version 1.16.0                
#r "nuget: NLayer, 1.16.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NLayer as a Cake Addin
#addin nuget:?package=NLayer&version=1.16.0

// Install NLayer as a Cake Tool
#tool nuget:?package=NLayer&version=1.16.0                

NLayer

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.

Usage

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.

Use with NAudio

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 Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on NLayer:

Package Downloads
NLayer.NAudioSupport

NAudio support for NLayer

YellowDogMan.CSCoreFork

Fork of CSCore by filoe

YellowDogMan.TESTCSCOREIGNORE

Fork of CSCore by filoe

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on NLayer:

Repository Stars
ValveResourceFormat/ValveResourceFormat
🔬 Valve's Source 2 resource file format parser, decompiler, and exporter.
Pyrdacor/Ambermoon.net
Ambermoon rewrite in C#
leezer3/OpenBVE
OpenBVE- A free train simulator
Version Downloads Last updated
1.16.0 1,783 10/8/2024
1.15.0 57,004 12/18/2023
1.14.0 129,852 9/7/2021
1.13.0 31,194 3/9/2020
1.12.0 78,566 6/19/2017
1.11.0 16,061 2/4/2017