NokitaKaze.WAVParser 0.1.0

dotnet add package NokitaKaze.WAVParser --version 0.1.0                
NuGet\Install-Package NokitaKaze.WAVParser -Version 0.1.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="NokitaKaze.WAVParser" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NokitaKaze.WAVParser --version 0.1.0                
#r "nuget: NokitaKaze.WAVParser, 0.1.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 NokitaKaze.WAVParser as a Cake Addin
#addin nuget:?package=NokitaKaze.WAVParser&version=0.1.0

// Install NokitaKaze.WAVParser as a Cake Tool
#tool nuget:?package=NokitaKaze.WAVParser&version=0.1.0                

WAV Parser

NuGet version (NokitaKaze.WAVParser) Travis

Yet another parser for wave files. I just like to write my own code.

This library could read 8/16/24/32/64-bit audio with WAVE_FORMAT_PCM (pcm_u8, pcm_s16le, pcm_s32le, pcm_s24le, pcm_s32le, pcm_s64le) format and 32/64-float bit with WAVE_FORMAT_IEEE_FLOAT (pcm_f32le, pcm_f64le).

Main reason for this library to exist is to support other library.

Using

You could read any media file, but you need to convert it to WAV.

ffmpeg -i some-media-file.raw -sn -vn -c:a pcm_s16le temporary.wav

Read

var parser = new NokitaKaze.WAVParser.WAVParser("input.wav");
Console.WriteLine("Channels count:\t{0}", parser.ChannelCount);
Console.WriteLine("AudioFormat:   \t{0}", parser.AudioFormat);
Console.WriteLine("BlockAlign:    \t{0}", parser.BlockAlign);
Console.WriteLine("SampleRate:    \t{0}Hz", parser.SampleRate);
Console.WriteLine("BitsPerSample: \t{0}", parser.SamplesCount);
Console.WriteLine("Duration:      \t{0}", parser.Duration);

foreach (var channelSamples in reReader.Samples)
{
    foreach (var sample in channelSamples)
    {
        // Hint: All samples are doubles for double precision processing
        Console.Write("{0:F8}, ", sample);
    }
}
// method 2
Stream stream;
var parser = new NokitaKaze.WAVParser.WAVParser(stream);

// method 3
var rawRiffStream = System.IO.File.ReadAllBytes("input.wav");
var parser = new NokitaKaze.WAVParser.WAVParser(byteArray);

Write

// method #1
var byteArray = parser.GetDataAsRiff();

// method #2
parser.Save("output.wav");

// method #3
Stream randomStream = ...;
parser.Save(randomStream);

Create new

var rnd = new System.Random.Random();

var parser = new NokitaKaze.WAVParser.WAVParser();
parser.ChannelCount = 1;
parser.Samples = new List<List<double>>() {new List<double>()};
parser.BlockAlign = (ushort) (parser.ChannelCount * parser.BitsPerSample / 8);

for (int i = 0; i < 1000; i++)
{
    // random samples to stream
    parser.Samples[0].Add(rnd.NextDouble() * 2 - 1);
}

parser.Save(...);
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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework 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 tizen40 was computed.  tizen60 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.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on NokitaKaze.WAVParser:

Package Downloads
SolidCode.Atlas.Development

Development version of Atlas

SolidCode.Atlas

A 2D .NET Game/App Framework for Windows and Linux

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 3,740 5/2/2020