Board index » cppbuilder » control volume
loukia
![]() CBuilder Developer |
loukia
![]() CBuilder Developer |
control volume2007-07-20 01:00:50 AM cppbuilder62 hi, i have a MediaPlayer playing some audio files using the Open() and Play() functions. I am using bds2006. How can i increase decrease the volume of the sound played?I would like to place a ProgressBar for this. Is there some tutorial or web page article that can help me do this? thanks |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-07-20 01:18:40 AM
Re:control volume
"loukia" < XXXX@XXXXX.COM >wrote in message
Quotei have a MediaPlayer playing some audio files using the directly, using the MCI_SETAUDIO command with the MCI_DGV_SETAUDIO_VOLUME flag. Pass the TMediaPlayer's DeviceID property as the first parameter to mciSendCommand() after Open() has succeeded. If that doesn't work, then try waveOutSetVolumn() instead. If that still doesn't work, then you are out of luck. You will have to use something other than TMediaPlayer, such as DirectX. Gambit |
JF Jolin
![]() CBuilder Developer |
2007-07-20 02:02:23 AM
Re:control volume
Hi loukia
19 Jul 2007 13:00:50 -0400, loukia < XXXX@XXXXX.COM >wrote: Quotehi, Quotethe sound played?I would like to place a ProgressBar for this. QuoteIs there some tutorial or web page article that can help me do this? __ JF Jolin {smallsort} |
Jonathan Benedicto
![]() CBuilder Developer |
2007-07-20 02:46:32 AM
Re:control volume
Remy Lebeau (TeamB) wrote:
QuoteIf that still doesn't work, then you are out of luck. You will have to AFAIK, one would have to use the mixer API. Jon |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-07-20 04:18:32 AM
Re:control volume
"Jonathan Benedicto" < XXXX@XXXXX.COM >wrote in message
QuoteUnless one uses DirectSound/DirectShow to play the play the file. Gambit |
loukia
![]() CBuilder Developer |
2007-07-20 03:17:37 PM
Re:control volume
thank you all for your answers the code that does the job is:
//TrackBar2->Max=0xFFFF; // TrackBar2->Min=0; int value =TrackBar2->Position; waveOutSetVolume(0, MAKELONG(value, value)); for mute (on-off): if (TrackBar2->Position!=0) { TrackBar2->Position=0; } else{TrackBar2->Position=TrackBar2->Max;} int value =TrackBar2->Position; waveOutSetVolume(0, MAKELONG(value, value)); "JF Jolin" < XXXX@XXXXX.COM >wrote in message QuoteHi loukia |