Harap posting sesuai dengan Kategorinya agar anggota yang lain mudah dalam bernavigasi!
0 Members and 1 Guest are viewing this topic.
*!* Ini buat browse All Sound Card#DEFINE MMSYSERR_NOERROR 0DO decl LOCAL nDevCount, nDevIndex nDevCount = waveOutGetNumDevs()IF nDevCount < 1* no waveform-audio output devices found RETURNENDIF CREATE CURSOR csDevices (mid I, pid I, drvver I, devname C(32)) FOR nDevIndex=0 TO nDevCount-1 DO QueryDevice WITH nDevIndexENDFOR GO TOPBROWSE NORMAL NOWAIT* end of main PROCEDURE QueryDevice(nIndex)*|typedef struct { *| WORD wMid; 0:2*| WORD wPid; 2:2*| MMVERSION vDriverVersion; 4:4*| TCHAR szPname[MAXPNAMELEN]; 8:32*| DWORD dwFormats; 40:4*| WORD wChannels; 44:2*| WORD wReserved1; 46:2*| DWORD dwSupport; 48:4*|} WAVEOUTCAPS; total 52 bytes#DEFINE WAVEOUTCAPS_SIZE 52 LOCAL cBuffer, nResult cBuffer = Repli(Chr(0), WAVEOUTCAPS_SIZE) nResult = waveOutGetDevCaps(nIndex, @cBuffer, WAVEOUTCAPS_SIZE) IF nResult <> MMSYSERR_NOERROR ? "Error:", GetWaveError(nResult) RETURN ENDIF LOCAL mid, pid, drvver, devname, formats, channels mid = buf2word(SUBSTR(cBuffer, 1,2)) pid = buf2word(SUBSTR(cBuffer, 3,2)) drvver = buf2dword(SUBSTR(cBuffer, 5,4)) devname = SUBSTR(cBuffer, 9,32) m.devname = SUBSTR(m.devname, 1, AT(Chr(0),m.devname)-1) INSERT INTO csDevices VALUES (m.mid, m.pid, m.drvver,; m.devname) FUNCTION GetWaveError(lnError) LOCAL lcBuf lcBuf = Repli(Chr(0), 250) = waveOutGetErrorText(lnError, @lcBuf, Len(lcBuf))RETURN STRTRAN(lcBuf, Chr(0),"") PROCEDURE decl DECLARE INTEGER waveOutGetNumDevs IN winmm DECLARE INTEGER waveOutGetDevCaps IN winmm; INTEGER uDeviceID, STRING @pwoc, LONG cbwoc DECLARE INTEGER waveOutGetErrorText IN winmm; INTEGER mmrError, STRING @pszText, LONG cchText FUNCTION buf2dword(lcBuffer)RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ; BitLShift(Asc(SUBSTR(lcBuffer, 2,1)), +; BitLShift(Asc(SUBSTR(lcBuffer, 3,1)), 16) +; BitLShift(Asc(SUBSTR(lcBuffer, 4,1)), 24) FUNCTION buf2word(lcBuffer)RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ; Asc(SUBSTR(lcBuffer, 2,1)) * 256*!* Trus Buka PortnyaDECLARE INTEGER waveOutOpen IN winmm; INTEGER @ phwo,; INTEGER uDeviceID,; STRING @ pwfx,; INTEGER dwCallback,; INTEGER dwCallbackInst,; INTEGER fdwOpen*!* trus mainkan file pada soundcard yg dipilihDECLARE INTEGER sndPlaySound IN winmm; STRING lpszSound,; INTEGER fuSoundlpszSound= GETENV("SystemRoot")+'\media\Windows XP Startup.wav' = sndPlaySound(lpszSound, 2)
DECLARE INTEGER sndPlaySound IN winmm; STRING lpszSound,; INTEGER fuSoundlpszSound= GETENV("SystemRoot")+'\media\Windows XP Startup.wav' = sndPlaySound(lpszSound, 2)
*!* Original Script by VB Public Const MMSYSERR_NOERROR = 0 Public Const MCI_SET = &H80D Public Const MCI_WAVE_OUTPUT = &H800000 Type MCI_WAVE_SET_PARMS dwCallback As Long dwTimeFormat As Long dwAudio As Long wInput As Long wOutput As Long wFormatTag As Integer wReserved2 As Integer nChannels As Integer wReserved3 As Integer nSamplesPerSec As Long nAvgBytesPerSec As Long nBlockAlign As Integer wReserved4 As Integer wBitsPerSample As Integer wReserved5 As Integer End Type Declare Function mciGetErrorString Lib "winmm.dll" _ Alias "mciGetErrorStringA" (ByVal dwError As Long, _ ByVal lpstrBuffer As String, ByVal uLength As Long) As Long Declare Function mciSendCommand Lib "winmm.dll" Alias _ "mciSendCommandA" (ByVal wDeviceID As Long, _ ByVal uMessage As Long, ByVal dwParam1 As Long, _ ByRef dwParam2 As Any) As Long
Dim parms As MCI_WAVE_SET_PARMS Dim rc As Long ' Specify the soundcard. This specifies the soundcard with a deviceID ' of 0. If you have a single soundcard, then this will open it. If you ' have multiple soundcards, the deviceIDs will be 0, 1, 2, etc. parms.wOutput = 0 ' Send the MCI command to set the output device. rc = mciSendCommand(MMControl1.DeviceID, MCI_SET, _ MCI_WAVE_OUTPUT, parms) if (rc <> MMSYSERR_NOERROR) then ' The command failed. End If
Tks mas armen atas infonyaakan saya coba untuk padanannya di foxprotks banyak
objWMIService = GetObject("winmgmts:\\.\root\CIMV2")colNet = objWMIService.ExecQuery("Select deviceid, Description, DeviceClass, Location from Win32_PNPSignedDriver WHERE DeviceClass = 'MEDIA' AND Location > 0")CREATE CURSOR curdrv (DeviceID c(50), Description c(50), DeviceClass C(20), Location C(30))INDEX ON DeviceClass TAG DevFOR EACH loDev IN colNet IF !ISNULL(loDev.Description) INSERT INTO curdrv VALUES (loDev.deviceid, loDev.Description, loDev.DeviceClass, IIF(ISNULL(loDev.Location ),'',loDev.Location )) ENDIF ENDFOR BROWSE
mas armen sudah sy cari untuk merubah Set Default AudioSound Direct Output itu di Wmplayer.ocx7 tapi tidak ada parameter yang berkaitan dengan audiosound direct output ?
saya nemu link ini saat googling:www.un4seen.com/forum/?topic=10621.0coba di cek, dan donlod 'BASS' -nya, disitu ada dll udah jadi serta contoh dg c/delphi/vb dan dokumentasi lengkap, yg mungkin bisa dipakai untuk keperluanmu. silahkan dipelajari.semoga berhasil.