Aural 1.2.0
dotnet add package Aural --version 1.2.0
NuGet\Install-Package Aural -Version 1.2.0
<PackageReference Include="Aural" Version="1.2.0" />
<PackageVersion Include="Aural" Version="1.2.0" />
<PackageReference Include="Aural" />
paket add Aural --version 1.2.0
#r "nuget: Aural, 1.2.0"
#:package Aural@1.2.0
#addin nuget:?package=Aural&version=1.2.0
#tool nuget:?package=Aural&version=1.2.0
Aural
Audio playback library for .NET — Play audio files with a single line of code using cross-platform OpenAL support.
Features
- Simple API: Play any audio file with
Player.Play(path, volume, loop) - Cross-platform: Works on Windows, macOS, and Linux automatically
- Format support: WAV, OGG Vorbis, MP3
- Playback control: Pause, resume, stop, volume adjustment, seeking
- Zero setup: No initialization required—just start playing
- Intuitive tokens: Control-based API via PlaybackToken objects
- Real-time filters: Low-pass, high-pass, reverb, and pitch shift (opt-in for zero overhead)
- OpenAL backend: Built on OpenTK.Audio.OpenAL for reliable, cross-platform audio
Installation
dotnet add package Aural
Quick Start
using Aural;
// Play an audio file
var token = Player.Play("path/to/song.mp3", 0.7f, loop: true);
// Let it play for 10 seconds
Thread.Sleep(10000);
// Pause playback
token.Pause();
Thread.Sleep(10000);
// Resume playback
token.Play();
Thread.Sleep(10000);
// Stop and release resources
token.End();
// Optional: cleanup all active playbacks on shutdown
Player.Dispose();
Audio Effects
Apply real-time filters to audio playback. All filters are disabled by default (zero performance cost). Enable only the filters you need.
Supported Filters
Low-Pass: Removes high frequencies (~0.5ms overhead)
- Parameters:
Frequency(20-20000 Hz),Resonance(0.5-5.0 Q) - Use case: Warm tone, remove noise
- Parameters:
High-Pass: Removes low frequencies (~0.5ms overhead)
- Parameters:
Frequency(20-2000 Hz),Resonance(0.5-5.0 Q) - Use case: Remove rumble, sub-bass
- Parameters:
Reverb: Schroeder reverberator for room ambience (~3-5ms overhead)
- Parameters:
RoomSize(0.0-1.0),DampFactor(0.0-1.0),Wet(0.0-1.0),Dry(0.0-1.0) - Use case: Space, ambience
- Parameters:
Pitch Shift: STFT phase vocoder for transposition (~10-15ms overhead, 50-200ms latency)
- Parameters:
SemiTones(-12 to +12),WindowSize(512, 1024, 2048) - Use case: Transpose music, karaoke, tuning adjustment
- Parameters:
Filter Example
using Aural;
using Aural.Filters;
// Create audio effect with filters
var effect = new AudioEffect
{
LowPass = new LowPassFilter
{
Enabled = true,
Frequency = 8000f, // Remove frequencies above 8kHz
Resonance = 1.0f
},
Reverb = new ReverbFilter
{
Enabled = true,
RoomSize = 0.7f, // Larger room
DampFactor = 0.5f, // Dampen high frequencies
Wet = 0.3f, // 30% reverb mix
Dry = 0.7f // 70% original signal
}
};
// Apply effects during playback
var token = Player.Play("song.mp3", volume: 0.8f, effect: effect);
// Query which filters are active
var activeEffects = token.GetActiveFilters();
Console.WriteLine($"Low-Pass: {activeEffects.LowPass.Enabled}");
Console.WriteLine($"Reverb: {activeEffects.Reverb.Enabled}");
Thread.Sleep(5000);
token.End();
Important Notes
- Immutability: The effect object is deep-cloned when playback starts. Modifications after
Play()have no effect. - Opt-In: Filters are disabled by default. Enable only what you need.
- Pitch Shift Latency: Expect 50-200ms latency with pitch shift enabled. Use smaller
WindowSizefor lower latency, larger for better quality. - Cross-Platform: All filters work identically on Windows, macOS, and Linux.
API Reference
Player.Play(filePath, volume, loop, effect)
Plays an audio file and returns a PlaybackToken for control.
Parameters:
filePath(string): Path to audio file (WAV, MP3, OGG)volume(float, default: 1.0): Volume level 0.0 (silent) to 1.0 (full)loop(bool, default: false): Whether to loop the audioeffect(AudioEffect?, default: null): Optional audio effects/filters to apply
Returns: PlaybackToken? - Control token, or null if playback failed
PlaybackToken Methods
Pause()- Pause playbackPlay()- Resume playbackEnd()- Stop and release resourcesSetVolume(float)- Adjust volume (0.0-1.0)Seek(float)- Seek to position in secondsGetActiveFilters()- Get reconstructed AudioEffect showing which filters are activeIsPlaying(property) - Check if audio is playingCurrentPosition(property) - Get current playback position in secondsDuration(property) - Get total audio duration in seconds
Player.Dispose()
Disposes all active playback sessions. Call on application shutdown.
Supported Formats
- WAV (.wav)
- OGG (.ogg)
- MPEG (.mp3)
Platform Support
- Windows
- macOS
- Linux
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- NLayer (>= 1.16.0)
- NVorbis (>= 0.10.5)
- OpenTK.Audio.OpenAL (>= 4.8.0)
-
net8.0
- NLayer (>= 1.16.0)
- NVorbis (>= 0.10.5)
- OpenTK.Audio.OpenAL (>= 4.8.0)
-
net9.0
- NLayer (>= 1.16.0)
- NVorbis (>= 0.10.5)
- OpenTK.Audio.OpenAL (>= 4.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.2.0: Added real-time audio filters (low-pass, high-pass, reverb, pitch shift) with opt-in complexity. v1.1.0: MP3 format support. v1.0: cross-platform audio playback for WAV and OGG.