A powerful and extensible cross-platform .NET audio engine. provides comprehensive audio processing capabilities including playback, recording, effects, analysis, and visualization, built with a modular and high-performance architecture.
$ dotnet add package SoundFlowA Powerful and Extensible .NET Audio Engine for Enterprise Applications
</div>SoundFlow is a robust and versatile .NET audio engine designed for seamless cross-platform audio processing. It provides a comprehensive set of features for audio playback, recording, processing, analysis, and visualization, all within a well-structured and extensible framework. SoundFlow empowers developers to build sophisticated audio applications, from real-time communication systems to advanced non-linear audio editors.
Key Features:
MiniAudio backend out of the box, with the ability to add others.NuGet Package Manager:
Install-Package SoundFlow.NET CLI:
dotnet add package SoundFlowThis example demonstrates how to play an audio file using SoundFlow:
using SoundFlow.Abstracts;
using SoundFlow.Backends.MiniAudio;
using SoundFlow.Components;
using SoundFlow.Providers;
using SoundFlow.Enums;
// Initialize the audio engine with the MiniAudio backend
// Ensure a sample rate compatible with WebRTC APM (8k, 16k, 32k, or 48k Hz) if using the APM extension.
using var audioEngine = new MiniAudioEngine(48000, Capability.Playback);
// Create a SoundPlayer and load an audio file
var player = new SoundPlayer(new StreamDataProvider(File.OpenRead("path/to/your/audiofile.wav")));
// Add the player to the master mixer
Mixer.Master.AddComponent(player);
// Start playback
player.Play();
// Keep the console application running until playback finishes
Console.WriteLine("Playing audio... Press any key to stop.");
Console.ReadKey();
// Stop playback and remove the player from the mixer
player.Stop();
Mixer.Master.RemoveComponent(player);SoundFlow is built upon a few key concepts:
AudioEngine): The central component that manages audio device initialization, data processing, and the audio graph.SoundComponent): Modular units that process or generate audio, forming a directed graph through input and output connections.Mixer): Combines multiple audio streams into a single output.SoundModifier): Apply audio effects like reverb, chorus, delay, and equalization.Composition): The top-level project file that defines a multi-track audio timeline, applies master effects, and manages persistence.Track): Containers within a Composition that hold AudioSegments. Tracks have their own settings for volume, pan, mute, solo, and can host effects/analyzers.AudioSegment): Individual audio clips placed on a Track's timeline. Segments reference a portion of an ISoundDataProvider and can apply segment-specific settings like fades, looping, reversal, speed, and pitch-preserved time stretching.WsolaTimeStretcher): An advanced internal component used by AudioSegment and SoundPlayerBase to perform high-quality, pitch-preserved time manipulation.For detailed information on these concepts, please refer to the SoundFlow Documentation.
SoundFlow's architecture supports adding specialized audio processing capabilities via dedicated NuGet packages. These extensions integrate external libraries, making their features available within the SoundFlow ecosystem, often as SoundModifiers or utility components.
This package provides an integration with a native library based on the WebRTC Audio Processing Module (APM). The WebRTC APM is a high-quality suite of algorithms commonly used in voice communication applications to improve audio quality.
Features included in this extension:
These features are primarily exposed through a single WebRtcApmModifier component, which is designed for real-time audio graph processing. A separate NoiseSuppressor component is also available for offline/batch processing of audio data from an ISoundDataProvider.
Learn more and find usage examples in the SoundFlow.Extensions.WebRtc.Apm README.
Note: The WebRTC APM native library has specific requirements, notably supporting only certain sample rates (8000, 16000, 32000, or 48000 Hz). Ensure your AudioEngine is initialized with one of these rates when using this extension.
Comprehensive API documentation will be available on the SoundFlow Documentation.
The Documentation provides a wide range of tutorials and examples to help you get started:
(Note: You can also find extensive example code in the Samples folder of the repository.)
We welcome contributions to SoundFlow! If you'd like to contribute, please follow these guidelines:
master branch.We sincerely appreciate the foundational work provided by the following projects and modules:
SoundFlow is an open-source project driven by passion and community needs. Maintaining and developing a project of this scale, especially with thorough audio testing, requires significant time and resources.
Currently, development and testing are primarily done using built-in computer speakers. Your support will directly help improve the quality of SoundFlow by enabling the purchase of dedicated headphones and audio equipment for more accurate and comprehensive testing across different audio setups.
Beyond equipment, your contributions, no matter the size, help to:
You can directly support SoundFlow and help me get essential headphones through:
AirTM: For simple one-time donations with various payment options like Direct Bank Transfer (ACH), Debit / Credit Card via Moonpay, Stablecoins, and more than 500 banks and e-wallets.
Binance Pay (Crypto - Preferred): Support with cryptocurrency via Binance Pay.
You can also scan this QR code in your Camera app:
By becoming a sponsor or making a donation, you directly contribute to the future of SoundFlow and help ensure it sounds great for everyone. Thank you for your generosity!
SoundFlow is released under the MIT License.