Control sound level for MediaPlayer
Hello,
I have an application with two MediaPlayers.
MediaPlayer1 I want to play a video and MediaPlayer2 I want to play a sound file.
My problem is that I don't know how to control the sound volume from MediaPlayer1.
How can I set sound volume to zero for MediaPlayer1?
AKJo
Junior Poster in Training
59 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
Thanks a lot Wolfgang,
I don't know what DWORD is so to make the compiler happy I replaced them to "word".
Then it compiles and runs, but it has ni invoke on the mediaplayer.
GetMPVolume gives 0 whatever I send through SetMPVolume, and the sound sounds the same.
Any ideas?
Regards
Arne
AKJo
Junior Poster in Training
59 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
Help reading have not tried it? DWORD is equivalent to LongWord.
uses
MPlayer, MMSystem, Types;
or replace DWORD on LongWord. Everything works fine. I attach a file for example.
Perfect!
"Types" made the difference.
Thank you very much.
AKJo
Junior Poster in Training
59 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
I found an other solution, that sets right and left volume with just an API call:
uses
...., MMSystem
then
WAVEOUTSETVOLUME(0, $80008000);
Will the suggested code (that also works fine, but I don't understand much of) give any advantages over WAVEOUTSETVOLUME or is WAVEOUTSETVOLUME just as good?
Any ideas?
AKJo
Junior Poster in Training
59 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0