| |
|
|
| iF (27.08.11)
... Hier eine minimale "Quick&Dirty"-Variante in "reinem" XProfan: KompilierenMarkierenSeparieren'{$cleq}
'{$runtime c:\dev\x11}
'{$compiler c:\dev\x11}
struct waveFormatEx=wFormatTag%,nChannels%,nSamplesperSec&,nAvgBytesPerSec&,nBlockAlign%,wBitsPerSample%,cbSize%
declare waveform#
var WaveHdrIn&=0
cls
usermessages 960
dim waveform#,waveFormatEx
with waveform#
.wFormatTag%=1
.nChannels%=1
.wBitsPerSample%=8
.nAvgBytesPerSec&=16000*1*8
.nSamplesPerSec&=16000
.nBlockAlign%=1
.cbSize%=0
endwith
var hWaveIn&=external("kernel32","GlobalAlloc",64,4)
case external("winmm","waveInOpen",hWaveIn&,-1,waveform#,%hWnd,0,65536) : end messagebox("ERROR","ERROR",4096)
hWaveIn&=long(hWaveIn&,0)
whileLoop 2
WaveHdrIn&=createWaveHdrIn()
external("winmm","waveInPrepareHeader",hWaveIn&,WaveHdrIn&,32)
external("winmm","waveInAddBuffer",hWaveIn&,WaveHdrIn&,32)
wend
external("winmm","waveInStart",hWaveIn&)
var peek!=0
var tmp&=0
while 1
waitinput
select %uMessage
caseof 960
if &uwParam=hWaveIn&
WaveHdrIn&=createWaveHdrIn()
external("winmm","waveInPrepareHeader",hWaveIn&,WaveHdrIn&,32)
external("winmm","waveInAddBuffer",hWaveIn&,WaveHdrIn&,32)
tmp&=abs(128-byte(long(&ulParam,0),0))*2
peek!=peek!*0.95
case peek!<tmp& : peek!=tmp&
usebrush 1,$FFFFFF
rectangle 0,0 - 40,256-peek!
usebrush 1,$FF
rectangle 0,(256-peek!) - 40,256
external("kernel32","GlobalFree",long(&ulParam,0))
external("kernel32","GlobalFree",&ulParam)
endif
endSelect
wend
end
proc createWaveHdrIn
var waveHdrIn&=external("kernel32","GlobalAlloc",64,32)
long waveHdrIn&,0=external("kernel32","GlobalAlloc",64,64),64
return waveHdrIn&
endproc
Herunterladen
Mehr zum Thema: [...] |
|
|
| |
|
|