English
Source / code snippets

take in Eingangspegel Mikrophon Waveinopen Waveinstart Winmm

 
iF (27.08.11)

...

here a minimale "Quick&Dirty"-Variante in "reinem" XProfan:
CompileMarkSeparation
'{$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&

ss=s4 href='./../../Function-References/XProfan/endproc/'>endproc

Download





More about: [...] 
 
08/27/11  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.009 Views

Untitledvor 0 min.
funkheld01/01/22
RAW10/24/21
Torsten Boo09/02/21
Sven Bader07/20/21
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie