listingnya
function GetWaveVolume(var LVol:DWORD;var RVol:DWORD):Boolean;
var
WaveOutCaps:TWAVEOUTCAPS;
Volume:DWORD;
begin
Result:=false;
if WaveOutGetdevCaps(WAVE_MAPPER,@WaveOutCaps,sizeof(WaveOutCaps))=MMSYSERR_NOERROR
then
if WaveOutCaps.dwSupport and WAVECAPS_VOLUME=WAVECAPS_VOLUME then
begin
Result:=WaveOutGetVolume(WAVE_MAPPER,@Volume)=MMSYSERR_NOERROR;
LVol:=LoWord(volume);
RVol:=HiWord(volume);
end;
end;
function SetWaveVolume(const AVolume:DWORD):Boolean;
var
WaveOutCaps:TWAVEOUTCAPS;
begin
if WaveOutGetdevCaps(WAVE_MAPPER,@WaveOutCaps,sizeof(WaveOutCaps))=MMSYSERR_NOERROR
then
if WaveOutCaps.dwSupport and WAVECAPS_VOLUME=WAVECAPS_VOLUME then
Result:=WaveOutSetVolume(WAVE_MAPPER,AVolume)=MMSYSERR_NOERROR;
end;
procedure Tfrmaudio.Button1Click(Sender: TObject);
begin
if OpenDialog1.execute then
begin
MediaPlayer1.Display:=Panel1;
lblnamafile.caption:=Opendialog1.filename;
MediaPlayer1.filename:=OpenDialog1.filename;
MediaPlayer1.Open;
ProgressBar1.Position:=MediaPlayer1.Position;
ProgressBar1.Max:=MediaPlayer1.Length;
MediaPlayer1.enabled:=true;
Timer1.enabled:=true;
end;
end;
procedure Tfrmaudio.Button2Click(Sender: TObject);
begin
application.Terminate;
end;
procedure Tfrmaudio.Timer1Timer(Sender: TObject);
begin
ProgressBar1.Position:=MediaPlayer1.Position;
end;
procedure Tfrmaudio.Button3Click(Sender: TObject);
var
LVol:DWORD;
RVol:DWORD;
begin
if GetWaveVolume(LVol,RVol) then
begin
SpinEdit1.Value:=LVol;
SpinEdit2.Value:=RVol;
end;
end;
procedure Tfrmaudio.Button4Click(Sender: TObject);
var
LVol:Word;
RVol:Word;
begin
LVol:=SpinEdit1.Value;
RVol:=SpinEdit2.Value;
SetWaveVolume(MakeLong(LVol,RVol));
end;
end.

dulu saya juga pernah coba nih..
BalasHapushttp://obatleukemia.toko-gumilar.com/