Newsgroup: it.comp.lang.visual-basic
Titolo: Leggere l'INPUT dalla scheda audio

Qualcuno ha un esempio di come leggere l'input dalla scheda audio, e in che
formato vengono letti i dati? Mi vorrei costruire una specie di
equalizzatore per filtrare l'audio in ingresso e poi riprodurlo nuovamente
in uscita.
Grazie in anticipo per l'eventuale aiuto!

Seguono le API che ti permettono di leggere l'input byte per byte. Il
formato del file generato è un Wave (RIFF Format). Che sappia io è l'unico
modo per controllare (e modificare) la frequenza dell'audio in input.
Probabilmente esistono altri metodi, con controlli prodotti da terze parti,
più semplici e immediati. L'uso di queste API, infatti, è abbastanza
complesso, poiché queste funzioni agiscono a basso livello, obbligandoti a
creare l'header, le informazioni sul file, sulla frequenza, sulla qualità
ecc.. C'è un esempio valido sulla  combinazione delle API da usare nella
directory Sample del Visual C++. Con le opportune traduzioni è possibile
ottenere il controllo da VB. Questo è quello che so, forse non è il massimo
ma spero sia d'aiuto.
Fabio Guerrazzi
'===========================================================================
==
Declare Function waveInAddBuffer Lib "winmm.dll" Alias "waveInAddBuffer"
(ByVal hWaveIn As Long, lpWaveInHdr As WAVEHDR, ByVal uSize As Long) As Long
Declare Function waveInClose Lib "winmm.dll" Alias "waveInClose" (ByVal
hWaveIn As Long) As Long
Declare Function waveInGetDevCaps Lib "winmm.dll" Alias "waveInGetDevCapsA"
(ByVal uDeviceID As Long, lpCaps As WAVEINCAPS, ByVal uSize As Long) As Long
Declare Function waveInGetErrorText Lib "winmm.dll" Alias
"waveInGetErrorTextA" (ByVal err As Long, ByVal lpText As String, ByVal
uSize As Long) As Long
Declare Function waveInGetID Lib "winmm.dll" Alias "waveInGetID" (ByVal
hWaveIn As Long, lpuDeviceID As Long) As Long
Declare Function waveInGetNumDevs Lib "winmm.dll" Alias "waveInGetNumDevs"
() As Long
Declare Function waveInGetPosition Lib "winmm.dll" Alias "waveInGetPosition"
(ByVal hWaveIn As Long, lpInfo As MMTIME, ByVal uSize As Long) As Long
Declare Function waveInOpen Lib "winmm.dll" Alias "waveInOpen" (lphWaveIn As
Long, ByVal uDeviceID As Long, lpFormat As WAVEFORMAT, ByVal dwCallback As
Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long
Declare Function waveInMessage Lib "winmm.dll" Alias "waveInMessage" (ByVal
hWaveIn As Long, ByVal msg As Long, ByVal dw1 As Long, ByVal dw2 As Long) As
Long
Declare Function waveInReset Lib "winmm.dll" Alias "waveInReset" (ByVal
hWaveIn As Long) As Long
Declare Function waveInStart Lib "winmm.dll" Alias "waveInStart" (ByVal
hWaveIn As Long) As Long
Declare Function waveInStop Lib "winmm.dll" Alias "waveInStop" (ByVal
hWaveIn As Long) As Long
Declare Function waveInUnprepareHeader Lib "winmm.dll" Alias
"waveInUnprepareHeader" (ByVal hWaveIn As Long, lpWaveInHdr As WAVEHDR,
ByVal uSize As Long) As Long
Type MMTIME
        wType As Long
        u As Long
End Type
Type WAVEFORMAT
        wFormatTag As Integer
        nChannels As Integer
        nSamplesPerSec As Long
        nAvgBytesPerSec As Long
        nBlockAlign As Integer
End Type
Type WAVEHDR
        lpData As String
        dwBufferLength As Long
        dwBytesRecorded As Long
        dwUser As Long
        dwFlags As Long
        dwLoops As Long
        lpNext As Long
        Reserved As Long
End Type
Type WAVEINCAPS
        wMid As Integer
        wPid As Integer
        vDriverVersion As Long
        szPname As String * MAXPNAMELEN
        dwFormats As Long
        wChannels As Integer
End Type