Skip to content

Cross-platform .NET Standard 3D audio engine based on OpenAL and various codecs

License

Notifications You must be signed in to change notification settings

project-grove/vox

Repository files navigation

Stability: alpha

About

This project is a cross-platform .NET Core/Standard 3D audio engine based on OpenAL.


Features


  • Based on the OpenAL 1.1 specification
  • Multiple output and sound capture devices
  • Full 3D sound support with different distance models, pitch shifting and other stuff
  • Bundled with PCM WAV, OGG and MP3 importers (thanks to NLayer and NVorbis)

Examples


For runnable examples check out the Samples directory.

Simple audio playback
var outputDevice = new OutputDevice();
...
var buffer = Wav.Load("never_gonna_give_you_up.wav");
...
var source = new SoundSource();
source.Enqueue(buffer);
source.Play();
Microphone capture
var inputDevice = new CaptureDevice();
...
inputDevice.StartCapture();
...
var samples = new byte[0];
// If you're running it in a game loop, you don't need a while loop here
// Just allocate a big enough buffer and reuse it
while (something)
{
    inputDevice.ProcessSamples((data, bytesRead) =>
    {
        var oldSize = samples.Length;
        Array.Resize(ref samples, oldSize + bytesRead);
        Array.Copy(data, 0, samples, oldSize, bytesRead);
    });
    Thread.Sleep(100);
}
...
inputDevice.StopCapture();
...
// Do something with the samples array
// Put the data from it in a SoundBuffer, for example
3D audio playback

Check out the SoundSource and Listener API documentation to take a look at what you can do.


Platform support


See the OpenAL.NETCore project.

About

Cross-platform .NET Standard 3D audio engine based on OpenAL and various codecs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published