Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help: Setting Volume for a TMediaPlayer component

1 view
Skip to first unread message

Franco Fabbri

unread,
Oct 19, 2001, 8:43:33 AM10/19/01
to
Hi, I must change volume before showing a trailer with TMediaPlayer
component. In Win98 I use this procedure ("Media" is a TMediaPlayer object):

procedure SetWaveVolume(const AVolume: DWord);
var
Woc : TWAVEOUTCAPS;
rc: Longint;
begin
FillChar(Woc,Sizeof(Woc),#0);
rc := WaveOutGetDevCaps(Media.DeviceID, @Woc, sizeof(Woc));
if rc = MMSYSERR_NOERROR then
if (Woc.dwSupport and WAVECAPS_VOLUME) = WAVECAPS_VOLUME then
WaveOutSetVolume(Media.DeviceID, AVolume);
end;

and it works well. If I try it on Win95, with the same soundboard and
drivers, it fails.
Does anybody know if there is another way to adjust volume?
I tried changing registry keys too, but this only affects MS Windows Media
Player volume, not a Delphi program .

Thanks a lot for any suggestion,
Best regards,

Franco Fabbri

0 new messages