Description
A cross-platform audio playback library that targets .NET Standard 2.1. The main purpose of this project is to provide easy to use API for playing and streaming audio especially in desktop environment.
Behind the scene, it uses FFmpeg to decode audio frames (so it is possible to play video files by taking only audio stream). And PortAudio for sending buffer data or samples to output device using blocking calls mechanism.
Bufdio alternatives and similar packages
Based on the "Media" category.
Alternatively, view Bufdio alternatives based on common mentions on social networks and blogs.
-
CSCore
An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited. -
Xabe.FFmpeg
.NET Standard wrapper for FFmpeg. It allows to process media without know how FFmpeg works, and can be used to pass customized arguments to FFmpeg from dotnet core application. -
Audio Tools Library (ATL) for .NET
Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
InfluxDB high-performance time series database

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Bufdio or a related project?
Popular Comparisons
README
Bufdio
A cross-platform audio playback library that targets .NET Standard 2.1. The main purpose of this project is to provides an easy to use API for playing and streaming audio file.
It uses FFmpeg to decode audio frames (so, it is possible to play audio stream from a video file). And PortAudio for writing audio stream to output device.
Example
Getting Started
This repository include pre-compiled PortAudio binaries for Windows, Linux, macOS that can be found at the libs directory. However, we can construct PortAudio and FFmpeg by using system-wide libraries.
BufdioLib.InitializePortAudio("path/to/portaudio");
BufdioLib.InitializeFFmpeg("path/to/ffmpeg/libraries");
// Or just use system-wide libraries
BufdioLib.InitializePortAudio();
BufdioLib.InitializeFFmpeg();
With PortAudio initialized, now we can retrieve available output devices.
var defaultDevice = BufdioLib.DefaultOutputDevice;
Console.WriteLine(defaultDevice.Name);
Console.WriteLine(defaultDevice.MaxOutputChannels);
Console.WriteLine(defaultDevice.DefaultSampleRate);
Console.WriteLine(defaultDevice.DefaultHighOutputLatency);
// Retrieve all available output devices
foreach (var device in BufdioLib.OutputDevices)
{
Console.WriteLine(device.Name);
}
Playing Audio Files
Bufdio provides high level interface for loading audio and control its playback state.
using IAudioPlayer player = new AudioPlayer();
// Methods
player.LoadAsync("audio-url-or-path");
player.LoadAsync(stream);
player.Play();
player.Pause();
player.Stop();
player.Seek(TimeSpan.FromSeconds(2));
// Properties
player.Volume;
player.CustomSampleProcessor;
player.Logger;
// Properties (read-only)
player.State;
player.IsSeeking;
player.IsLoaded;
player.Duration;
player.Position;
// Events
player.StateChanged += OnStateChanged;
player.PositionChanged += OnPositionChanged;
Generate Sine Wave
Bufdio also exposes low level IAudioEngine
interface for sending or writing samples to an output device.
const int SampleRate = 8000;
const float Frequency = 350f;
const float Amplitude = 0.35f * short.MaxValue;
var samples = new float[SampleRate];
var options = new AudioEngineOptions(1, SampleRate);
using IAudioEngine engine = new PortAudioEngine(options);
for (var i = 0; i < samples.Length; i++)
{
samples[i] = (float)(Amplitude * Math.Sin(2 * Math.PI * i * Frequency / SampleRate));
}
Console.WriteLine("Playing 10 times with 1 second delay..");
for (var i = 0; i < 10; i++)
{
engine.Send(samples);
Thread.Sleep(1000);
}
TODO
- Still need more unit tests
Credits
Similar Projects
License
Bufdio is licenced under the MIT license.
*Note that all licence references and agreements mentioned in the Bufdio README section above
are relevant to that project's source code only.