2009-07-17 51 views

回答

-3
char *mp3FilePath = ... ; 
char *workingDirPath = ... ; 
ShellExecute(hwnd, "open", mp3FilePath, NULL, workingDirPath, SW_SHOWNORMAL); 
+1

他說'沒有關聯的應用程序'... – Martijn 2009-07-17 14:48:42

2

使用Shoban的鏈接如何播放聲音。

下面介紹如何控制音量的設備:

uses MMSystem; 

type 
    TVolumeRec = record 
    case Integer of 
     0: (LongVolume: Longint) ; 
     1: (LeftVolume, RightVolume : Word) ; 
    end; 

const DeviceIndex=5 
     {0:Wave 
     1:MIDI 
     2:CDAudio 
     3:Line-In 
     4:Microphone 
     5:Master 
     6:PC-loudspeaker} 

procedure SetVolume(aVolume:Byte) ; 
var 
    Vol: TVolumeRec; 
begin 
    Vol.LeftVolume := aVolume shl 8; 
    Vol.RightVolume:= Vol.LeftVolume; 
    auxSetVolume(UINT(DeviceIndex), Vol.LongVolume) ; 
end; 

function GetVolume:Cardinal; 
var 
    Vol: TVolumeRec; 
begin 
    AuxGetVolume(UINT(DeviceIndex),@Vol.LongVolume) ; 
    Result:=(Vol.LeftVolume + Vol.RightVolume) shr 9; 
end; 
2

如果這對非商業用途時,BASS庫是免費的,給你你正在尋找的控制。

3DBuzz有免費的視頻教程,其中之一是創建自己的MP3播放器。它們位於首頁的視頻分類列表中。

0

只需使用MM的API(噸上MSDN和谷歌的樣本)

+0

MM?那是什麼API? – Jlouro 2009-07-20 07:51:35

相關問題