TensorStack.Audio.Windows 0.1.18

Prefix Reserved
dotnet add package TensorStack.Audio.Windows --version 0.1.18
                    
NuGet\Install-Package TensorStack.Audio.Windows -Version 0.1.18
                    
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="TensorStack.Audio.Windows" Version="0.1.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TensorStack.Audio.Windows" Version="0.1.18" />
                    
Directory.Packages.props
<PackageReference Include="TensorStack.Audio.Windows" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TensorStack.Audio.Windows --version 0.1.18
                    
#r "nuget: TensorStack.Audio.Windows, 0.1.18"
                    
#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.
#:package TensorStack.Audio.Windows@0.1.18
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TensorStack.Audio.Windows&version=0.1.18
                    
Install as a Cake Addin
#tool nuget:?package=TensorStack.Audio.Windows&version=0.1.18
                    
Install as a Cake Tool

TensorStack.Audio.Windows

TensorStack.Audio.Windows provides Windows-specific support for reading and writing audio using FFmpeg. It allows loading audio information, reading and writing audio tensors, and muxing audio into video files.


AudioInput

AudioInput wraps an audio file into a convenient object backed by an AudioTensor. It allows loading, manipulating, and saving audio.

// Load Audio

AudioInput audioInput = new AudioInput("speech.wav");

AudioInput audioInputAsync = await AudioInput.CreateAsync("speech.wav");


// With custom codec, sample rate, and channels

AudioInput audioInput = new AudioInput("music.mp3", "pcm_f32le", 44100, 2);

AudioInput audioInputAsync = await AudioInput.CreateAsync("music.mp3", "pcm_f32le", 44100, 2);


// Save Audio

audioInput.Save("output.wav");

await audioInput.SaveAsync("output.wav");

Notes

  • AudioInput uses AudioManager internally to handle the audio tensor.
  • AudioManager.Initialize only needed for custom FFmpeg/FFprobe binaries or a different temp directory; the NuGet package provides defaults.

AudioManager

AudioManager is a static helper class for loading, saving, and processing audio files. It can read audio into tensors, write tensors back to audio files, extract audio from videos, and add audio to videos. It uses FFmpeg/FFprobe under the hood and provides both synchronous and asynchronous methods.

Load Audio Information

AudioInfo info = AudioManager.LoadInfo("file.wav");

AudioInfo info = await AudioManager.LoadInfoAsync("file.wav");

Returns metadata including codec, sample rate, channels, duration, and sample count.


Load Audio Tensor

AudioTensor tensor = AudioManager.LoadTensor("file.wav", "pcm_s16le", 16000, 1);

AudioTensor tensor = await AudioManager.LoadTensorAsync("file.wav", "pcm_s16le", 16000, 1);

AudioTensor contains the raw audio samples in float32 format.


Save Audio Tensor

AudioManager.SaveAudio("output.wav", tensor);

await AudioManager.SaveAudioAync("output.wav", tensor);

Add Audio to Video

AudioManager.AddAudio("video.mp4", "sourceAudio.mp3");

await AudioManager.AddAudioAsync("video.mp4", "sourceAudio.mp3");

This muxes the audio from the source file into the target video.


Initialization

The NuGet package supplies FFmpeg binaries. Initialization is only needed if you want to use custom binaries or a different location:

AudioManager.Initialize("ffmpeg.exe", "ffprobe.exe", "Temp");

This sets up the executable paths and temporary directory used for conversions.


Notes

  • All audio I/O uses FFmpeg under the hood.
  • Asynchronous methods use Task and support cancellation.
  • Audio data is handled in float32 format internally.

Product Compatible and additional computed target framework versions.
.NET net9.0-windows10.0.17763 is compatible.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.18 163 10/23/2025
0.1.17 80 10/17/2025
0.1.9 160 10/13/2025