This is a very early integration of https://miniaud.io/ into Open 3D Engine as a Gem. It has the most fundamental features working already: sound playback, sound positioning, and listener positioning. One can test the sounds in the Editor viewport without entering game mode.
- Wav (in main branch)
- Mp3, Flac and Ogg support is available in development branch (to be tested and merged to main when appropriate)
- MiniAudio Playback Component
- MiniAudio Listener Component
- Declare a dependency in your cmake target on
Gem::MiniAudio.API
:BUILD_DEPENDENCIES PUBLIC ... Gem::MiniAudio.API
- Include the header file, for example
#include <MiniAudio/MiniAudioPlaybackBus.h>
- Invoke MiniAudioPlaybackRequestBus interface
MiniAudio::MiniAudioPlaybackRequestBus::Event(GetEntityId(), &MiniAudio::MiniAudioPlaybackRequestBus::Events::Play);
- Or get a direct pointer to the interface:
if (auto bus = MiniAudio::MiniAudioPlaybackRequestBus::FindFirstHandler(GetEntityId())) { bus->Play(); }
- You can also declare a dependency of a component on a particular component of MiniAudio, such as:
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) { required.push_back(AZ_CRC_CE("MiniAudioPlaybackComponent")); }
The following nodes are exposed to scripting.
Same license as Open 3D Engine, see https://github.com/o3de/o3de