Hey ocramot,
I’m not hugely knowledgeable about the media player specifically (gmpreussner is currently the expert) but I can help you with general mixing.
The sound that you are playing with the media player is a USoundWave type which has all the power of other audio, including sound classes and sound mixes.
Unfortunately, the UE4 mix system isn’t well documented (I’m working on getting that documented!) but briefly, the way it works is:
-
- Create a sound class that you want to play your media sound waves with (or any sound wave)
-
- Set whatever
default volumes you want with the
sound class
- Set whatever
-
- Make sure to add this new sound class as the sound class field of the sound waves you want to affect with it.
-
- Create a sound mix
(USoundMix) with the volume of
the sound class you want to set to 0
in the “sound class adjustment” list
of the sound mix
- Create a sound mix
-
- When you want to
mute the mix of the sound classes
based on gameplay, from BP, use the
function PushSoundMixModifier and
pass in the sound mix you want to add
to the mix.
- When you want to
-
- When you want to remove
the muting mix, just call
PopSoundMixModifier with the
soundmix.
- When you want to remove
Some cool things about the mix system is that you can have any number of sound mixes at the same and their sound-class adjustments “mix” together in the way you’d expect. You can also have sound mixes trigger automatically based on volume thresholds in a sound class (sort of like a ducking system).