Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example:
#COMPILE EXE
#INCLUDE "WIN32API.INC"
DECLARE FUNCTION mciSendString LIB "WINMM.DLL" ALIAS "mciSendStringA"_
(lpstrCommand AS ASCIIZ, lpstrReturnString AS ASCIIZ, _
BYVAL uReturnLength AS LONG, BYVAL hwndCallback AS LONG) AS LONG
CALLBACK FUNCTION Dlg_Proc() AS LONG
SELECT CASE CBMSG
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE 100
mciSendString "open new Type waveaudio Alias capture", BYVAL %NULL, 0, 0
mciSendString "set capture %bitspersample 8", BYVAL %NULL, 0, 0
mciSendString "set capture %samplespersec 11025", BYVAL %NULL, 0, 0
mciSendString "set capture %channels 1", BYVAL %NULL, 0, 0
mciSendString "record capture", BYVAL %NULL, 0, 0
CASE 200
mciSendString "stop capture", BYVAL %NULL, 0, 0
mciSendString "save capture C:\NewWave32.wav", BYVAL %NULL, 0, 0
mciSendString "close capture", BYVAL %NULL, 0, 0
mcisendString "play C:\NewWave32.wav", BYVAL %NULL, 0, BYVAL %NULL
END SELECT
CASE %WM_DESTROY
PostQuitMessage 0
EXIT FUNCTION
END SELECT
END FUNCTION ' (Dlg_Proc)
FUNCTION PBMAIN () AS LONG
LOCAL hDlg AS LONG
DIALOG NEW 0, "mciSendString", 160, 150, 210, 110,%ws_sysmenu TO hDlg
CONTROL ADD BUTTON, hDlg, 100, "START", 20, 30, 50, 14,
CONTROL ADD BUTTON, hDlg, 200, "STOP", 84, 30, 50, 14,
DIALOG SHOW MODELESS hDlg&, CALL Dlg_Proc()
DO
DIALOG DOEVENTS TO Count&
LOOP WHILE Count&
END FUNCTION
http://www.garybeene.com/sw/gbsnippets.htm