How to mute/lower sound in Media Player

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:

    1. Create a sound class that you want to play your media sound waves with (or any sound wave)
    1. Set whatever
      default volumes you want with the
      sound class
    1. Make sure to add this new sound class as the sound class field of the sound waves you want to affect with it.
    1. 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
    1. 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.
    1. When you want to remove
      the muting mix, just call
      PopSoundMixModifier with the
      soundmix.

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).

1 Like