Create Metasound Interface

In this video, it’s shown that custom Interfaces for metasounds can be made.

Minute 19:

I’ve scoured the docs and internet but can not find anyone who’s done this.

I’d like to make an interface the returns a custom hearing state for the player listening to the metasound, similar to how attenuation gives info about the distance a metasound has to a listener.

Goal would be to have a hearingComponent which would populate this interface for any metasound they are listening to.

Any help or resource, or where for instance the other interfaces are made. I found the IAudioParameterInterfaceRegistry where the other default interfaces are added:

Audio::IAudioParameterInterfaceRegistry& InterfaceRegistry = Audio::IAudioParameterInterfaceRegistry::Get();
InterfaceRegistry.RegisterInterface(Audio::AttenuationInterface::GetInterface());
InterfaceRegistry.RegisterInterface(Audio::SpatializationInterface::GetInterface());
InterfaceRegistry.RegisterInterface(Audio::SourceOrientationInterface::GetInterface());
InterfaceRegistry.RegisterInterface(Audio::ListenerOrientationInterface::GetInterface());

but that’s as far as I’ve got in the code rabbit hole. Will post here if I find more.

Ok, I’ve created an interface by copying the SountAttenuation interface example.

AudioSettings.cpp
ActiveSound.cpp
SoundAttenuation.h
SoundAttenuation.cpp

While this works, I’m pretty sure an external interface can be defined and registered using RegisterExternalInterfaces → MetasoundInterface.cpp

I’ll look into how this can be done, instead of injecting code into the files to include a custom interface where the engine default interfaces be.