Please help me get the volume control to work on the Media Player

This problem seems to have existed since 2016. I don’t think anyone has ever gotten the volume control to work on the media player, and there are no examples on the entire internet of a basic, working media player; WITH simple volume control, for Unreal Engine.

I can get Media Player to PLAY and STOP, but I cannot change the volume no matter what I try.

Here is my code.

I press the 3 hotkey in the level blueprint, and it plays the MP3 file successfully using the media player. I added a Cube object into my level, then added a Media Sound component to it. That media sound component is set to use the Media Player object in the content browser.

image

I can successfully stop the Music from playing using 6 hotkey.

Now, I just need to control its volume. Simple, right? NO. lol

I hit the 4 hotkey, and tried using the set volume multiplier synth, since it’s the only one that can plugin, and it accesses the same Media Sound component from the level, but the volume refuses to change.

image

I hit the 5 hotkey, and tried using the Set Native Volume. I also ensured the Media Sound Component was not using the Music Sound Class, it’s basically empty. I tried it empty and with a sound class, but it doesn’t work.

I tried using a Music Sound Class Mix, but it still won’t change the volume.

Can someone help me simply control the volume of the media player after playing an MP3 file from path?

Basically, I"m hitting the 3 hotkey to play the song, then I want to hit hotkey 3 or 4 to alter the volume, then I hit hotkey 6 to just stop the music. Basic media player control, but I cannot change the volume no matter what I try.

In a perfect world, I should be able to just drag off the Media Player object in the blueprint, then it should have an action called CHANGE VOLUME, how hard is that? lol

I’m interested in what progress you make with this. In that perhaps a simple sequencer beat maker app could be made using UE4.

Surely there is a way to hook up to an on screen knob widget for volume control. If you can figure it out, the next mountain to climb for a sequencer app would be how to effectively create panning left and right (for a panning knob) which also is also a volume issue between the two stereo speakers left and right.

I agree with you this should be a relatively simple thing, unfortunately I can’t offer you any insight on this issue, maybe someday though…for now I just offer your thread a bump and hope you receive an answer on this.

1 Like

I got it working pretty simply, dunno why it’s not working for you. I’ll post what I did in a sec… Try changing the value you have here from -1000 to 0 and see if that works.

I changed it to 0 and tried again, the volume will not change.

(The reason I typed -1000 to begin with was frustration.)

I appreciate you posting the solution. I wonder if it’s something outside of Unreal Engine that’s causing the problem? I hope not.

This is what I’m doing. My version is 4.20.

I appreciate that code.

  1. Is the Event BeginPlay from the level blueprint?

  2. How is your Media Sound Component defined in your blueprint? Is there a relationship between it and a Media Sound Component; on an actor, in your level?

It won’t let me just drag the Media Sound Component from the actor to the blueprint unfortunately.

It’s in a blueprint, but it should work from the level bp, too.

Just added it as a component with the media player variable set. That’s it.


This is the same thing but done in the level blueprint (either one works):

Using a reference to the actor:

Using a tag (you need to add a tag to the actor for this to work):

You can’t access it directly because you’re adding the component to an actor in the level, not the class, so it’s not part of the class (same as adding it at runtime). This is why you have to use the “Get Component” node.

Thank you. I got it to work finally.

There are so many other people who were trying to do this. It should help them too. Thanks again.

Now we can PLAY, STOP and change volume. The core basics. I wish they added how to change volume in their documentation.

2 Likes