MonoGame/MonoGame

Drop OpenAL in favor of a better audio library

Open

#7,817 opened on May 23, 2022

View on GitHub
 (7 comments) (2 reactions) (0 assignees)C# (13,886 stars) (3,071 forks)batch import
AndroidAudioHelp WantedLinuxMacOSiOS

Description

While OpenAL does exactly what MonoGame needs for the most part and is available on a wide range of systems, it is hardly compatible with XAudio.

XAudio is the API toward which MonoGame (and formerly XNA) has been design for. The problem is that XAudio isn't available outside of Windows and Xbox platforms.

OpenAL came as a workaround and has been used to implement an XAudio-like API on macOS, Linux, iOS/iPadOS, and Android.

However, OpenAL functions quite differently than XAudio and there are many features (like effects, or even applying a pitch/pan) which renders differently. This isn't just mathematical conversion issues. The effect API for instance, is so differently designed that it is plainly impossible to make an OpenAL effect to consistently sound exactly like its XAudio counterpart.

If we'd like to aim for accuracy and have all platforms sound the same, we should be looking into replacing OpenAL with a sound library that allows 1:1 XAudio mapping, and be available on macOS, Linux, iOS/iPadOS, and Android.

So far, the best candidate is FAudio, though it would need mobile ports.

Contributor guide