0

I am using TMediaPlayer to play music and videos which works fine, but I want to control the volume using a trackbar that can slide from low to medium to high. Can someone please help me on how to code it or is there any other method to do it?

Thanks!

B.Anderson
  • 21
  • 6
  • 1
    First you need to find a way to set the audio volume in Win32 (I am sure Google and existing StackOverflow questions know a lot about that). *Then* you need to "attach" that code to a track bar. So basically you are asking two things in a single Q here (even though the GUI part is trivial). [I mean, tomorrow we might get a Q asking how to control the volume in Win32 using a scroll bar control, and the day after that a Q asking how to control the volume in Win32 using an edit box, and the day after that...] – Andreas Rejbrand Mar 20 '19 at 21:25
  • Look at [`waveOutSetVolume()`](https://learn.microsoft.com/en-us/previous-versions/dd743874(v%3Dvs.85)), or [`IAudioVolumeLevel`](https://learn.microsoft.com/en-us/windows/desktop/api/devicetopology/nn-devicetopology-iaudiovolumelevel)/[`ISimpleAudioVolume`](https://learn.microsoft.com/en-us/previous-versions//ms679138(v=vs.85)). – Remy Lebeau Mar 21 '19 at 01:19
  • If this is a FMX application then you could simply use Volume property of TMediaPlayer component. Unforttunately such property isn't available in VCL verstion of TMediaPlyer component. – SilverWarior Mar 22 '19 at 11:49

0 Answers0