Board index » cppbuilder » control volume

control volume


2007-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
 
 

Re:control volume

"loukia" < XXXX@XXXXX.COM >wrote in message
Quote
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?
TMediaPlayer does not provide that functionality.
You can try calling the Win32 Multimedia API mciSendCommand() function
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
 

Re:control volume

Hi loukia
19 Jul 2007 13:00:50 -0400, loukia < XXXX@XXXXX.COM >wrote:
Quote
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 MCIWndSetVolume macro sets the volume level of an MCI device.
Quote
the sound played?I would like to place a ProgressBar for this.
A ProgressBar is usualy used to indicate the progress of a lengthy operation.
I think your talking of a slider control ?
Quote
Is there some tutorial or web page article that can help me do this?
A good API programmer's reference under "MCI Devices" and "Sliders"
respectively might just be a good place where to start.
__
JF Jolin
 

{smallsort}

Re:control volume

Remy Lebeau (TeamB) wrote:
Quote
If that still doesn't work, then you are out of luck. You will have to
use
something other than TMediaPlayer, such as DirectX.
Unless one uses DirectSound/DirectShow to play the audio, I don't think that
DiurectX will help here.
AFAIK, one would have to use the mixer API.
Jon
 

Re:control volume

"Jonathan Benedicto" < XXXX@XXXXX.COM >wrote in message
Quote
Unless one uses DirectSound/DirectShow to play the
audio, I don't think that DiurectX will help here.
I wasn't suggesting to mix TMediaPlayer and DirectX together. I was
referring to getting rid of TMediaPlayer altogether and using DirectX to
play the file.
Gambit
 

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
Quote
Hi loukia

19 Jul 2007 13:00:50 -0400, loukia < XXXX@XXXXX.COM >wrote:

>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 MCIWndSetVolume macro sets the volume level of an MCI device.

>the sound played?I would like to place a ProgressBar for this.

A ProgressBar is usualy used to indicate the progress of a lengthy
operation.
I think your talking of a slider control ?

>Is there some tutorial or web page article that can help me do this?

A good API programmer's reference under "MCI Devices" and "Sliders"
respectively might just be a good place where to start.


__
JF Jolin