关闭打开声道

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
关闭声道
 
uses MMSystem;
procedure SetMediaAudioOff(DeviceID : word);
var
SetParm : TMCI_SET_PARMS;
begin
SetParm.dwAudio := MCI_SET_AUDIO_ALL;
mciSendCommand(DeviceID,
MCI_SET,
MCI_SET_AUDIO or MCI_SET_OFF,
Longint(@SetParm));
end;
Procedure SetMediaAudioOn(DeviceID : word);
var
SetParm : TMCI_SET_PARMS;
begin
SetParm.dwAudio := MCI_SET_AUDIO_ALL;
mciSendCommand(DeviceID,
MCI_SET,
MCI_SET_AUDIO or MCI_SET_ON,
Longint(@SetParm));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
{Play AVI file silently}
MediaPlayer1.FileName := 'C:.AVI';
MediaPlayer1.Display := Panel1;
MediaPlayer1.Open;
MediaPlayer1.Play;
SetMediaAudioOff(MediaPlayer1.DeviceId);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
{Play AVI with sound}
MediaPlayer1.FileName := 'C:.AVI';
MediaPlayer1.Display := Panel1;
MediaPlayer1.Open;
MediaPlayer1.Play;
SetMediaAudioOn(MediaPlayer1.DeviceId);
end;
 
 
 

Similar threads

I
回复
0
查看
729
import
I
I
回复
0
查看
631
import
I
I
回复
0
查看
814
import
I
I
回复
0
查看
496
import
I
后退
顶部