VuMetre Audio

pcpunch Messages postés 1243 Date d'inscription mardi 7 mai 2002 Statut Membre Dernière intervention 18 février 2019 - 16 févr. 2004 à 22:46
comemich Messages postés 39 Date d'inscription jeudi 3 février 2005 Statut Membre Dernière intervention 23 août 2017 - 4 nov. 2007 à 22:34
Slt, je cherche un moyen d'inclure a ma table de mixage fait en vb avec des controles Wmp un genre de vu metre , ou une representation graphique du son!
Si qq a une piste???

13 réponses

Tilois Messages postés 721 Date d'inscription dimanche 10 juin 2001 Statut Membre Dernière intervention 27 mars 2011 7
16 févr. 2004 à 23:14
La lib FMOD pourrat peut etre t'aider..
http://www.fmod.org/
0
cs_azerty25 Messages postés 1114 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 6 mai 2007
17 févr. 2004 à 09:24
@Z3RtY25 ==
0
cs_azerty25 Messages postés 1114 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 6 mai 2007
17 févr. 2004 à 09:25
Oups, le site déconne, le message n'a pas été pris ! :-/
Je disai que sa n'est pas si qu'il recherche éxactement mais que c'est quand mm génial, merci pr le tuyau :)

@Z3RtY25 ==
0
cs_azerty25 Messages postés 1114 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 6 mai 2007
17 févr. 2004 à 09:53
Oups, le site déconne, le message n'a pas été pris ! :-/
Je disai que sa n'est pas si qu'il recherche éxactement mais que c'est quand mm génial, merci pr le tuyau :)

@Z3RtY25 ==
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
pcpunch Messages postés 1243 Date d'inscription mardi 7 mai 2002 Statut Membre Dernière intervention 18 février 2019 5
17 févr. 2004 à 09:58
effectivement je veu le coder!!!! donc c pas vraiment ce que je recherche
++
0
cs_azerty25 Messages postés 1114 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 6 mai 2007
17 févr. 2004 à 10:07
Ah bon, je disai sa car c'était une animation graphique style winamp ou WMP9 que ce projet possède
Si tu veux le faire toi meme, je pense pas qu'en VB sa soit fesable, pas assez puissant je pense :-/ Essaye plutot de te tourner vers qq chose style C++ ;)

@Z3RtY25 ==
0
pcpunch Messages postés 1243 Date d'inscription mardi 7 mai 2002 Statut Membre Dernière intervention 18 février 2019 5
17 févr. 2004 à 10:18
Non j'ai parcouru cette lib vite fais mais je ne pense pas qu'elle permet de realiser une representation graphique d'un son(genre vumetre) et il est vrai que j'utilise 2 ctrl Wmp!!! Sinon elle semble interessante!!

Mais n'est il pas possible de recupérer les mesures du son a la sortie de la carte son!! afin de faire ce vumetre!!! qui je le precise est seulement une sorte de progressbar verticale!!!
0
wackybacky Messages postés 8 Date d'inscription mardi 26 octobre 2004 Statut Membre Dernière intervention 18 avril 2008
28 oct. 2004 à 22:48
Tu peux peut-être t'orienter vers l'API winmm.dll :shock)
C'est Indigeste, je sais mais... avec un peu de taf...
Source: http://www.vbfrance.com/code.aspx?ID=20803
Voilà quelques infos sur son fonctionnement:


Public hmixer As Long                      ' mixer handle
Public inputVolCtrl As MIXERCONTROL        ' waveout volume control
Public outputVolCtrl As MIXERCONTROL       ' microphone volume control
Public rc As Long                          ' return code
Public OK As Boolean                       ' boolean return code
Public mxcd As MIXERCONTROLDETAILS         ' control info
Public vol As MIXERCONTROLDETAILS_SIGNED   ' control's signed value
Public volume As Long                      ' volume value
Public volHmem As Long                     ' Volume Buffer

Public VolValue As Double

' Frequencies

Public Enum Frequency
    Freq60hz = 60
    Freq170hz = 170
    Freq310hz = 310
    Freq600hz = 600
    Freq3khz = 3
    Freq6khz = 6
    Freq12khz = 12
    Freq14khz = 14
    Freq31hz = 32.3
    Freq62hz = 62.5
    Freq125hz = 125
    Freq250hz = 250
    Freq500hz = 500
    Freq1khz = 1
    Freq2khz = 2
    Freq4khz = 4
    Freq8khz = 8
    Freq16khz = 16.1
End Enum

' Volume Unit Display(Number of Display) Values

Public Type VULights
    VUOn As Boolean
    InOutLev As Double
    VolLev As Double
    VULev As Double
    VolUnit As Variant
    VUArray As Long
    Freq(0 To 9) As Double
    FreqNum As Integer
    FreqVal As Double
End Type

Declare Sub ReleaseCapture Lib "user32" ()
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
'  Sound APIŽs
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Declare Function waveOutGetNumDevs Lib "winmm" () As Long

Global Const SND_SYNC = &H0 'just after the sound is ended exit function
Global Const SND_ASYNC = &H1 'just after the beginning of the sound exit function
Global Const SND_NODEFAULT = &H2 'if the sound cannot be found no error message
Global Const SND_LOOP = &H8 'repeat the sound until the function is called again
Global Const SND_NOSTOP = &H10 'if currently a sound is played the function will return without playing the selected sound
Global Const Flags& = SND_ASYNC Or SND_NODEFAULT
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Public Const CALLBACK_FUNCTION = &H30000
Public Const MM_WIM_DATA = &H3C0
Public Const WHDR_DONE = &H1         '  done bit
Public Const GMEM_FIXED = &H0         ' Global Memory Flag used by GlobalAlloc functin

Type WAVEHDR
' The WAVEHDR user-defined type defines the header used to identify a waveform-audio buffer.
   lpData As Long          ' Address of the waveform buffer.
   dwBufferLength As Long  ' Length, in bytes, of the buffer.
   dwBytesRecorded As Long ' When the header is used in input, this member specifies how much
                           ' data is in the buffer.

   dwUser As Long          ' User data.
   dwFlags As Long         ' Flags supplying information about the buffer. Set equal to zero.
   dwLoops As Long         ' Number of times to play the loop. Set equal to zero.
   lpNext As Long          ' Not used
   Reserved As Long        ' Not used
End Type

Type WAVEINCAPS
' The WAVEINCAPS user-defined variable describes the capabilities of a waveform-audio input
' device.
   wMid As Integer         ' Manufacturer identifier for the device driver for the
                           ' waveform-audio input device. Manufacturer identifiers
                           ' are defined in Manufacturer and Product Identifiers in
                           ' the Platform SDK product documentation.
   wPid As Integer         ' Product identifier for the waveform-audio input device.
                           ' Product identifiers are defined in Manufacturer and Product
                           ' Identifiers in the Platform SDK product documentation.
   vDriverVersion As Long  ' Version number of the device driver for the
                           ' waveform-audio input device. The high-order byte
                           ' is the major version number, and the low-order byte
                           ' is the minor version number.
   szPname As String * 32  ' Product name in a null-terminated string.
   dwFormats As Long       ' Standard formats that are supported. See the Platform
                           ' SDK product documentation for more information.
   wChannels As Integer    ' Number specifying whether the device supports
                           ' mono (1) or stereo (2) input.
End Type

Type WAVEFORMAT
' The WAVEFORMAT user-defined type describes the format of waveform-audio data. Only
' format information common to all waveform-audio data formats is included in this
' user-defined type.
   wFormatTag As Integer      ' Format type. Use the constant WAVE_FORMAT_PCM Waveform-audio data
                              ' to define the data as PCM.
   nChannels As Integer       ' Number of channels in the waveform-audio data. Mono data uses one
                              ' channel and stereo data uses two channels.
   nSamplesPerSec As Long     ' Sample rate, in samples per second.
   nAvgBytesPerSec As Long    ' Required average data transfer rate, in bytes per second. For
                              ' example, 16-bit stereo at 44.1 kHz has an average data rate of
                              ' 176,400 bytes per second (2 channels ? 2 bytes per sample per
                              ' channel ? 44,100 samples per second).
   nBlockAlign As Integer     ' Block alignment, in bytes. The block alignment is the minimum atomic unit of data. For PCM data, the block alignment is the number of bytes used by a single sample, including data for both channels if the data is stereo. For example, the block alignment for 16-bit stereo PCM is 4 bytes (2 channels ? 2 bytes per sample).
   wBitsPerSample As Integer  ' For buffer estimation
   cbSize As Integer          ' Block size of the data.
End Type

Declare Function waveInOpen Lib "winmm.dll" (lphWaveIn As Long, _
                                             ByVal uDeviceID As Long, _
                                             lpFormat As WAVEFORMAT, _
                                             ByVal dwCallback As Long, _
                                             ByVal dwInstance As Long, _
                                             ByVal dwFlags As Long) As Long
' The waveInOpen function opens the given waveform-audio input device for recording. The function
' uses the following parameters
'     lphWaveIn-  a long value that is the handle identifying the open waveform-audio input
'                 device. Use this handle to identify the device when calling other
'                 waveform-audio input functions. This parameter can be NULL if WAVE_FORMAT_QUERY
'                 is specified for fdwOpen.
'     uDeviceID-  a long value that identifies the waveform-audio input device to open.
'                 This parameter can be either a device identifier or a handle of an open
'                 waveform-audio input device.
'     lpFormat-   the WAVEFORMAT user-defined typed that identifies the desired format for
'                 recording waveform-audio data.
'     dwCallback- a long value that is an event handle, a handle to a window, or the identifier
'                 of a thread to be called during waveform-audio recording to process messages
'                 related to the progress of recording. If no callback function is required,
'                 this value can be zero. For more information on the callback function,
'                 see waveInProc.
'     dwCallback- a long value that is the user-instance data passed to the callback mechanism.
'                 This parameter is not used with the window callback mechanism.
'     dwFlags-    Flags for opening the device. The following values are defined:
'                 CALLBACK_EVENT (&H50000)-event handle.
'                 CALLBACK_FUNCTION (&H30000)-callback procedure address.
'                 CALLBACK_NULL (&H00000)-No callback mechanism. This is the default setting.
'                 CALLBACK_THREAD (&H20000)-thread identifier.
'                 CALLBACK_WINDOW (&H10000)-window handle.
'                 WAVE_FORMAT_DIRECT (&H8)-ACM driver does not perform conversions on the
'                                            audio data.
'                 WAVE_FORMAT_QUERY (&H1)-queries the device to determine whether it supports
'                                         the given format, but it does not open the device.
'                 WAVE_MAPPED (&H4)-The uDeviceID parameter specifies a waveform-audio device
'                                   to be mapped to by the wave mapper.

Declare Function waveInPrepareHeader Lib "winmm.dll" (ByVal hWaveIn As Long, _
                                                      lpWaveInHdr As WAVEHDR, _
                                                      ByVal uSize As Long) As Long
' The waveInPrepareHeader function prepares a buffer for waveform-audio input. The function
' uses the following parameters:
'     hWaveIn-    a long value that is the handle of the waveform-audio input device.
'     lpWaveInHdr-the WAVEHDR user-defined type variable.
'     uSize-      the size in bytes of the WAVEHDR user-defined type variable. Use the
'                 results of the Len function for this parameter.

Declare Function waveInReset Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
' The waveInReset function stops input on the given waveform-audio input device and resets
' the current position to zero. All pending buffers are marked as done and returned to
' the application. The function requires the handle to the waveform-audio input device.

Declare Function waveInStart Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
' The waveInStart function starts input on the given waveform-audio input device. The function
' requires the handle of the waveform-audio input device.

Declare Function waveInStop Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
' The waveInStop function stops waveform-audio input. The function requires the handle of
' the waveform-audio input device.

Declare Function waveInUnprepareHeader Lib "winmm.dll" _
                                          (ByVal hWaveIn As Long, _
                                          lpWaveInHdr As WAVEHDR, _
                                          ByVal uSize As Long) As Long
' The waveInUnprepareHeader function cleans up the preparation performed by the
' waveInPrepareHeader function. This function must be called after the device driver
' fills a buffer and returns it to the application. You must call this function before
' freeing the buffer. The function uses the following parameters:
'     hWaveIn-       a long value that is the handle of the waveform-audio input device.
'     lpWaveInHdr-   the variable typed as the WAVEHDR user-defined type identifying the
'                    buffer to be cleaned up.
'     uSize-         a long value that is the size in bytes, of the WAVEHDR varaible. Use
'                    the Len function with the WAVEHDR variable as the argument to get this
'                    value.

Declare Function waveInClose Lib "winmm.dll" (ByVal hWaveIn As Long) As Long
' The waveInClose function closes the given waveform-audio input device. The function
' requires the handle of the waveform-audio input device. If the function succeeds,
' the handle is no longer valid after this call.

Declare Function waveInGetDevCaps Lib "winmm.dll" Alias "waveInGetDevCapsA" _
                  (ByVal uDeviceID As Long, _
                  lpCaps As WAVEINCAPS, _
                  ByVal uSize As Long) As Long
' This function retrieves the capabilities of a given waveform-audio input device. You can
' use this function to determine the number of waveform-audio input devices present in the
' system. If the value specified by the uDeviceID parameter is a device identifier,
' it can vary from zero to one less than the number of devices present. The function uses
' the following parameters
'     uDeviceID-     long value that identifies waveform-audio output device. This value can be
'                    either a device identifier or a handle of an open waveform-audio input device.
'     lpCaps-user-   defined variable containing information about the capabilities of the device.
'     uSize-         the size in bytes of the user-defined variable used as the lpCaps parameter.
'                    Use the Len function to get this value.

Declare Function waveInGetNumDevs Lib "winmm.dll" () As Long
' The waveInGetNumDevs function returns the number of waveform-audio input devices present in the system.

Declare Function waveInGetErrorText Lib "winmm.dll" Alias "waveInGetErrorTextA" _
                     (ByVal err As Long, _
                     ByVal lpText As String, _
                     ByVal uSize As Long) As Long
'The waveInGetErrorText function retrieves a textual description of the error identified by
' the given error number. The function uses the following parameters:
'     Err-     a long value that is the error number.
'     lpText-  a string variable that contains the textual error description.
'     uSize-   the size in characters of the lpText string variable.

Declare Function waveInAddBuffer Lib "winmm.dll" (ByVal hWaveIn As Long, _
                                                   lpWaveInHdr As WAVEHDR, _
                                                   ByVal uSize As Long) As Long
' The waveInAddBuffer function sends an input buffer to the given waveform-audio input device.
' The function uses the following parameters:
'     hWaveIn-       a long value that is the handle of the waveform-audio input device.
'     lpWaveInHdr-   the variable typed as the WAVEHDR user-defined type.
'     uSize-         a long value that is the size in bytes of the variable typed as the
'                    WAVEHDR user-defined variable. Use the Len function with the WAVEHDR
'                    variable as the argument to get this value.

Public Const MMSYSERR_NOERROR = 0
Public Const MAXPNAMELEN = 32

Public Const MIXER_LONG_NAME_CHARS = 64
Public Const MIXER_SHORT_NAME_CHARS = 16
Public Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3&
Public Const MIXER_GETCONTROLDETAILSF_VALUE = &H0&
Public Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2&

Public Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0&
Public Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000&
Public Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
Public Const MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
Public Const MIXERLINE_COMPONENTTYPE_SRC_LINE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)

Public Const MIXERCONTROL_CT_CLASS_FADER = &H50000000
Public Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000
Public Const MIXERCONTROL_CT_UNITS_SIGNED = &H20000
Public Const MIXERCONTROL_CT_CLASS_METER = &H10000000
Public Const MIXERCONTROL_CT_SC_METER_POLLED = &H0&
Public Const MIXERCONTROL_CONTROLTYPE_FADER = (MIXERCONTROL_CT_CLASS_FADER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
Public Const MIXERCONTROL_CONTROLTYPE_VOLUME = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
Public Const MIXERLINE_COMPONENTTYPE_DST_WAVEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
Public Const MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
Public Const MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER Or MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_SIGNED)
Public Const MIXERCONTROL_CONTROLTYPE_PEAKMETER = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)

Declare Function mixerClose Lib "winmm.dll" (ByVal hmx As Long) As Long
' The mixerClose function closes the specified mixer device. The function requires the
' handle of the mixer device. This handle must have been returned successfully by the
' mixerOpen function. If mixerClose is successful, the handle is no longer valid.

Declare Function mixerGetControlDetails Lib "winmm.dll" Alias "mixerGetControlDetailsA" _
            (ByVal hmxobj As Long, _
            pMxcd As MIXERCONTROLDETAILS, _
            ByVal fdwDetails As Long) As Long
' The mixerGetControlDetails function retrieves details about a single control associated
' with an audio line. the function uses the following parameters:
'     hmxobj-     a long value that is the handle to the mixer device object being queried.
'     pMxcd-      the variable defined as the MIXERCONTROLDETAILS user-defined type.
'     fdwDetails- Flags for retrieving control details. The following values are defined:
'                    MIXER_GETCONTROLDETAILSF_LISTTEXT-The paDetails member of the
'                       MIXERCONTROLDETAILS user-defined variable points to one or more
'                       MIXERCONTROLDETAILS_LISTTEXT user-defined variables to receive text
'                       Displays for multiple-item controls. An application must get all list
'                       text items for a multiple-item control at once. This flag cannot be
'                       used with MIXERCONTROL_CONTROLTYPE_CUSTOM controls.
'                    MIXER_GETCONTROLDETAILSF_VALUE-Current values for a control are
'                       retrieved. The paDetails member of the MIXERCONTROLDETAILS user-defined
'                       variable points to one or more details appropriate for the control class.
'                    MIXER_OBJECTF_AUX (&H50000000)-The hmxobj parameter is an auxiliary device
'                       identifier in the range of zero to one less than the number of devices
'                       returned by the auxGetNumDevs function.
'                    MIXER_OBJECTF_HMIDIIN (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)-
'                       The hmxobj parameter is the handle of a MIDI (Musical Instrument Digital
'                       Interface) input device. This handle must have been returned by the
'                       midiInOpen function.
'                    MIXER_OBJECTF_HMIDIOUT (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)-The
'                       hmxobj parameter is the handle of a MIDI output device. This handle must
'                       have been returned by the midiOutOpen function.
'                    MIXER_OBJECTF_HMIXER (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)-The
'                       hmxobj parameter is a mixer device handle returned by the mixerOpen
'                       function. This flag is optional.
'                    MIXER_OBJECTF_HWAVEIN (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)-The
'                       hmxobj parameter is a waveform-audio input handle returned by the
'                       waveInOpen function.
'                    MIXER_OBJECTF_HWAVEOUT ((MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)-The
'                       hmxobj parameter is a waveform-audio output handle returned by the
'                       waveOutOpen function.
'                    MIXER_OBJECTF_MIDIIN (&H40000000L)-The hmxobj parameter is the identifier
'                       of a MIDI input device. This identifier must be in the range of zero to
'                       one less than the number of devices returned by the midiInGetNumDevs
'                       function.
'                    MIXER_OBJECTF_MIDIOUT (&H30000000)-The hmxobj parameter is the identifier
'                       of a MIDI output device. This identifier must be in the range of zero
'                       to one less than the number of devices returned by the midiOutGetNumDevs
'                       function.
'                    MIXER_OBJECTF_MIXER (&H00000000)-The hmxobj parameter is the identifier of a
'                       mixer device in the range of zero to one less than the number of devices
'                       returned by the mixerGetNumDevs function. This flag is optional.
'                    MIXER_OBJECTF_WAVEIN (&H20000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio input device in the range of zero to one less than the
'                       number of devices returned by the waveInGetNumDevs function.
'                    MIXER_OBJECTF_WAVEOUT (&H10000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio output device in the range of zero to one less than the
'                       number of devices returned by the waveOutGetNumDevs function.

Declare Function mixerGetDevCaps Lib "winmm.dll" Alias "mixerGetDevCapsA" _
                  (ByVal uMxId As Long, _
                  ByVal pmxcaps As MIXERCAPS, _
                  ByVal cbmxcaps As Long) As Long
' The mixerGetDevCaps function queries a specified mixer device to determine its capabilities.
' The function uses the following parameters:
'     uMxId-      a long value that is the handle of an open mixer device.
'     pmxcaps-    a variable defined as the MIXERCAPS user-defined type to contain information
'                 about the capabilities of the device.
'     cbmxcaps-   a long value that is the size in bytes, of the variable defined as the
'                 MIXERCAPS user-defined type. Use the Len functions with the MIXERCAPS variable
'                 as the argument to get this value.

Declare Function mixerGetID Lib "winmm.dll" (ByVal hmxobj As Long, _
                                             pumxID As Long, _
                                             ByVal fdwId As Long) As Long
' The mixerGetID function retrieves the device identifier for a mixer device associated
' with a specified device handle.The function uses the following parameters:
'     hmxobj-  a long value that is the handle of the audio mixer object to map to a
'              mixer device identifier.
'     pumxID-  the long value to contain the mixer device identifier. If no mixer device
'              is available for the hmxobj object, the value ? 1 is placed in this location
'              and the MMSYSERR_NODRIVER error value is returned.
'     fdwId-   Flags for mapping the mixer object hmxobj. The following values are defined:
'                 MIXER_OBJECTF_AUX (&H50000000)-The hmxobj parameter is an auxiliary device
'                       identifier in the range of zero to one less than the number of devices
'                       returned by the auxGetNumDevs function.
'                 MIXER_OBJECTF_HMIDIIN (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)-
'                       the hmxobj parameter is the handle of a MIDI input device. This handle
'                       must have been returned by the midiInOpen function.
'                 MIXER_OBJECTF_HMIDIOUT (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)-The
'                       hmxobj parameter is the handle of a MIDI output device. This handle must
'                       have been returned by the midiOutOpen function.
'                 MIXER_OBJECTF_HMIXER (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)-The hmxobj
'                       parameter is a mixer device handle returned by the mixerOpen function.
'                       This flag is optional.
'                 MIXER_OBJECTF_HWAVEIN (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)-The
'                       hmxobj parameter is a waveform-audio input handle returned by the
'                       waveInOpen function.
'                 MIXER_OBJECTF_HWAVEOUT ((MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)-The
'                       hmxobj parameter is a waveform-audio output handle returned by the
'                       waveOutOpen function.
'                 MIXER_OBJECTF_MIDIIN (&H40000000L)-The hmxobj parameter is the identifier of
'                       a MIDI input device. This identifier must be in the range of zero to
'                       one less than the number of devices returned by the midiInGetNumDevs
'                       function.
'                 MIXER_OBJECTF_MIDIOUT (&H30000000)-The hmxobj parameter is the identifier of
'                       a MIDI output device. This identifier must be in the range of zero to
'                       one less than the number of devices returned by the midiOutGetNumDevs
'                       function.
'                 MIXER_OBJECTF_MIXER (&H00000000)-The hmxobj parameter is the identifier of
'                       a mixer device in the range of zero to one less than the number of
'                       devices returned by the mixerGetNumDevs function. This flag is optional.
'                 MIXER_OBJECTF_WAVEIN (&H20000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio input device in the range of zero to one less than the
'                       number of devices returned by the waveInGetNumDevs function.
'                 MIXER_OBJECTF_WAVEOUT (&H10000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio output device in the range of zero to one less than the
'                       number of devices returned by the waveOutGetNumDevs function.

Declare Function mixerGetLineControls Lib "winmm.dll" Alias "mixerGetLineControlsA" _
                  (ByVal hmxobj As Long, _
                  pmxlc As MIXERLINECONTROLS, _
                  ByVal fdwControls As Long) As Long
' The mixerGetLineControls function retrieves one or more controls associated with an audio
' line. The function uses the following parameters:
'     hmxobj-        a long value that is the handle of the mixer device object that is being
'                    queried.
'     pmxlc-         the variable defined as the MIXERLINECONTROLS user-defined type used to
'                    reference one or more variables defined as theMIXERCONTROL user-defined
'                    types to be filled with information about the controls associated with
'                    an audio line. The cbStruct member of the MIXERLINECONTROLS variable
'                    must always be initialized to be the size, in bytes, of the
'                    MIXERLINECONTROLS variable.
'     fdwControls-   Flags for retrieving information about one or more controls associated w
'                    with an audio line. The following values are defined:
'                    MIXER_GETLINECONTROLSF_ALL-The pmxlc parameter references a list of
'                       MIXERCONTROL variables that will receive information on all controls
'                       associated with the audio line identified by the dwLineID member of
'                       the MIXERLINECONTROLS structure. The cControls member must be initialized
'                       to the number of controls associated with the line. This number is
'                       retrieved from the cControls member of the MIXERLINE structure returned
'                       by the mixerGetLineInfo function. The cbmxctrl member must be
'                       initialized to the size, in bytes, of a single MIXERCONTROL variable.
'                       The pamxctrl member must point to the first MIXERCONTROL variable to be
'                       filled. The dwControlID and dwControlType members are ignored for this
'                       query.
'                    MIXER_GETLINECONTROLSF_ONEBYID-The pmxlc parameter references a single
'                       MIXERCONTROL variable that will receive information on the control
'                       identified by the dwControlID member of the MIXERLINECONTROLS variable.
'                       The cControls member must be initialized to 1. The cbmxctrl member must
'                       be initialized to the size, in bytes, of a single MIXERCONTROL variable.
'                       The pamxctrl member must point to a MIXERCONTROL structure to be filled.
'                       The dwLineID and dwControlType members are ignored for this query. This
'                       query is usually used to refresh a control after receiving a
'                       MM_MIXM_CONTROL_CHANGE control change notification message by the
'                       user-defined callback (see mixerOpen).
'                    MIXER_GETLINECONTROLSF_ONEBYTYPE-The mixerGetLineControls function
'                       retrieves information about the first control of a specific class for
'                       the audio line that is being queried. The pmxlc parameter references a
'                       single MIXERCONTROL structure that will receive information about the
'                       specific control. The audio line is identified by the dwLineID member.
'                       The control class is specified in the dwControlType member of the
'                       MIXERLINECONTROLS variable. The dwControlID member is ignored for this
'                       query. This query can be used by an application to get information on
'                       a single control associated with a line. For example, you might want
'                       your application to use a peak meter only from a waveform-audio output
'                       line.
'                    MIXER_OBJECTF_AUX (&H50000000)-The hmxobj parameter is an auxiliary device
'                       identifier in the range of zero to one less than the number of devices
'                       returned by the auxGetNumDevs function.
'                    MIXER_OBJECTF_HMIDIIN (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)-The
'                       hmxobj parameter is the handle of a MIDI input device. This handle must
'                       have been returned by the midiInOpen function.
'                    MIXER_OBJECTF_HMIDIOUT (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)-The
'                       hmxobj parameter is the handle of a MIDI output device. This handle must
'                       have been returned by the midiOutOpen function.
'                    MIXER_OBJECTF_HMIXER (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)-The
'                       hmxobj parameter is a mixer device handle returned by the mixerOpen
'                       function. This flag is optional.
'                    MIXER_OBJECTF_HWAVEIN (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)-The
'                       hmxobj parameter is a waveform-audio input handle returned by the
'                       waveInOpen function.
'                    MIXER_OBJECTF_HWAVEOUT ((MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)-The
'                       hmxobj parameter is a waveform-audio output handle returned by the
'                       waveOutOpen function.
'                    MIXER_OBJECTF_MIDIIN (&H40000000L)-The hmxobj parameter is the identifier of
'                       a MIDI input device. This identifier must be in the range of zero to one
'                       less than the number of devices returned by the midiInGetNumDevs function.
'                    MIXER_OBJECTF_MIDIOUT (&H30000000)-The hmxobj parameter is the identifier of
'                       a MIDI output device. This identifier must be in the range of zero to one
'                       less than the number of devices returned by the midiOutGetNumDevs function.
'                    MIXER_OBJECTF_MIXER (&H00000000)-The hmxobj parameter is the identifier of a
'                       mixer device in the range of zero to one less than the number of devices
'                       returned by the mixerGetNumDevs function. This flag is optional.
'                    MIXER_OBJECTF_WAVEIN (&H20000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio input device in the range of zero to one less than the
'                       number of devices returned by the waveInGetNumDevs function.
'                    MIXER_OBJECTF_WAVEOUT (&H10000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio output device in the range of zero to one less than the
'                       number of devices returned by the waveOutGetNumDevs function.

Declare Function mixerGetLineInfo Lib "winmm.dll" Alias "mixerGetLineInfoA" _
                     (ByVal hmxobj As Long, _
                     pmxl As MIXERLINE, _
                     ByVal fdwInfo As Long) As Long
' The mixerGetLineInfo function retrieves information about a specific line of a mixer device.
' Uses the same parameters and constants as the mixerGetLineControls function.

Declare Function mixerGetNumDevs Lib "winmm.dll" () As Long
' The mixerGetNumDevs function retrieves the number of mixer devices present in the system.

Declare Function mixerMessage Lib "winmm.dll" (ByVal hmx As Long, _
                                                ByVal uMsg As Long, _
                                                ByVal dwParam1 As Long, _
                                                ByVal dwParam2 As Long) As Long
' The mixerMessage function sends a custom mixer driver message directly to a mixer driver.
' The function uses the following parameters:
'     hmx-     a long value that is the handle of an open instance of a mixer device. This
'              value is the result of the mixerOpen function.
'     uMsg-    Custom mixer driver message to send to the mixer driver. This message must
'              be above or equal to the MXDM_USER constant.
'     dwParam1 and dwParam2-Arguments associated with the message being sent.

Declare Function mixerOpen Lib "winmm.dll" (phmx As Long, _
                                             ByVal uMxId As Long, _
                                             ByVal dwCallback As Long, _
                                             ByVal dwInstance As Long, _
                                             ByVal fdwOpen As Long) As Long
' The mixerOpen function opens a specified mixer device and ensures that the device will
' not be removed until the application closes the handle. the function uses the following
' parameters:
'     phmx-       a long value that is the handle identifying the opened mixer device. Use
'                 this handle to identify the device when calling other audio mixer functions.
'                 This parameter cannot be NULL.
'     uMxId-      a long value that identifies the mixer device to open. Use a valid device
'                 identifier or any HMIXEROBJ (see the mixerGetID function for a description of
'                 mixer object handles). A "mapper" for audio mixer devices does not currently
'                 exist, so a mixer device identifier of ? 1 is not valid.
'     dwCallback- Handle of a window called when the state of an audio line and/or control
'                 associated with the device being opened is changed. Specify zero for this
'                 parameter if no callback mechanism is to be used.
'     dwInstance- User instance data passed to the callback function. This parameter is not
'                 used with window callback functions.
'     fdwOpen-    Flags for opening the device. The following values are defined:
'                    CALLBACK_WINDOW-  The dwCallback parameter is assumed to be a window handle.
'                    MIXER_OBJECTF_AUX (&H50000000)-The uMxId parameter is an auxiliary device
'                       identifier in the range of zero to one less than the number of devices
'                       returned by the auxGetNumDevs function.
'                    MIXER_OBJECTF_HMIDIIN (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)-the
'                       uMxId parameter is the handle of a MIDI input device. This handle must
'                       have been returned by the midiInOpen function.
'                    MIXER_OBJECTF_HMIDIOUT (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)-The
'                       uMxId parameter is the handle of a MIDI output device. This handle must
'                       have been returned by the midiOutOpen function.
'                    MIXER_OBJECTF_HMIXER (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)-The uMxId
'                       parameter is a mixer device handle returned by the mixerOpen function.
'                       This flag is optional.
'                    MIXER_OBJECTF_HWAVEIN (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)-The
'                       uMxId parameter is a waveform-audio input handle returned by the
'                       waveInOpen function.
'                    MIXER_OBJECTF_HWAVEOUT (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)-The
'                       uMxId parameter is a waveform-audio output handle returned by the
'                       waveOutOpen function.
'                    MIXER_OBJECTF_MIDIIN (&H40000000)-The uMxId parameter is the identifier of
'                       a MIDI input device. This identifier must be in the range of zero to one
'                       less than the number of devices returned by the midiInGetNumDevs function.
'                    MIXER_OBJECTF_MIDIOUT (&H30000000)-The uMxId parameter is the identifier of
'                       a MIDI output device. This identifier must be in the range of zero to one
'                       less than the number of devices returned by the midiOutGetNumDevs function.
'                    MIXER_OBJECTF_MIXER (&H00000000)-The uMxId parameter is a mixer device
'                       identifier in the range of zero to one less than the number of devices
'                       returned by the mixerGetNumDevs function. This flag is optional.
'                    MIXER_OBJECTF_WAVEIN (&H20000000)-The uMxId parameter is the identifier of a
'                       waveform-audio input device in the range of zero to one less than the
'                       number of devices returned by the waveInGetNumDevs function.
'                    MIXER_OBJECTF_WAVEOUT (&H10000000)-The uMxId parameter is the identifier of a
'                       waveform-audio output device in the range of zero to one less than the
'                       number of devices returned by the waveOutGetNumDevs function.

Declare Function mixerSetControlDetails Lib "winmm.dll" _
         (ByVal hmxobj As Long, _
         pMxcd As MIXERCONTROLDETAILS, _
         ByVal fdwDetails As Long) As Long
' The mixerSetControlDetails function sets properties of a single control associated with an
' audio line. The function uses the following parameters
'     hmxobj-        a long value that is the handle of the mixer device object for which
'                    properties are being set.
'     pMxcd-         the variable declares as the MIXERCONTROLDETAILS user-defined type.
'                    This variable references the control detail structures that contain the
'                    desired state for the control.
'     fdwDetails-    Flags for setting properties for a control. The following values are
'                    defined:
'                    MIXER_OBJECTF_AUX (&H50000000)-The hmxobj parameter is an auxiliary device
'                       identifier in the range of zero to one less than the number of devices
'                       returned by the auxGetNumDevs function.
'                    MIXER_OBJECTF_HMIDIIN (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)-
'                       The hmxobj parameter is the handle of a MIDI input device. This handle
'                       must have been returned by the midiInOpen function.
'                    MIXER_OBJECTF_HMIDIOUT (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)-The
'                       hmxobj parameter is the handle of a MIDI output device. This handle must
'                       have been returned by the midiOutOpen function.
'                    MIXER_OBJECTF_HMIXER (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)-The hmxobj
'                       parameter is a mixer device handle returned by the mixerOpen function.
'                       This flag is optional.
'                    MIXER_OBJECTF_HWAVEIN (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)-The
'                       hmxobj parameter is a waveform-audio input handle returned by the
'                       waveInOpen function.
'                    MIXER_OBJECTF_HWAVEOUT ((MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)-The
'                       hmxobj parameter is a waveform-audio output handle returned by the
'                       waveOutOpen function.
'                    MIXER_OBJECTF_MIDIIN (&H40000000)-The hmxobj parameter is the identifier
'                       of a MIDI inputdevice. This identifier must be in the range of zero to
'                        one less than the number of devices returned by the midiInGetNumDevs
'                        function.
'                    MIXER_OBJECTF_MIDIOUT (&H30000000)-The hmxobj parameter is the identifier
'                       of a MIDI output device. This identifier must be in the range of zero
'                       to one less than the number of devices returned by the midiOutGetNumDevs
'                       function.
'                    MIXER_OBJECTF_MIXER (&H00000000)-The hmxobj parameter is a mixer device
'                       identifier in the range of zero to one less than the number of devices
'                       returned by the mixerGetNumDevs function. This flag is optional.
'                    MIXER_OBJECTF_WAVEIN (&H20000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio input device in the range of zero to one less than the
'                       number of devices returned by the waveInGetNumDevs function.
'                    MIXER_OBJECTF_WAVEOUT (&H10000000)-The hmxobj parameter is the identifier of a
'                       waveform-audio output device in the range of zero to one less than the
'                       number of devices returned by the waveOutGetNumDevs function.
'                    MIXER_SETCONTROLDETAILSF_CUSTOM-A custom dialog box for the specified
'                       custom mixer control is displayed. The mixer device gathers the required
'                       information from the user and returns the data in the specified buffer.
'                       The handle for the owning window is specified in the hwndOwner member
'                       of the MIXERCONTROLDETAILS structure. (This handle can be set to NULL.)
'                       The application can then save the data from the dialog box and use it
'                       later to reset the control to the same state by using the
'                       MIXER_SETCONTROLDETAILSF_VALUE flag.
'                    MIXER_SETCONTROLDETAILSF_VALUE (&H00000000)-The current value(s) for a control
'                       are set. The paDetails member of the MIXERCONTROLDETAILS structure points
'                       to one or more mixer-control details structures of the appropriate class for
'                       the control.

Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory" (struct As Any, ByVal ptr As Long, ByVal cb As Long)
Declare Sub CopyPtrFromStruct Lib "kernel32" Alias "RtlMoveMemory" (ByVal ptr As Long, struct As Any, ByVal cb As Long)
' The CopyStructFromPtr and CopyPtrFromStruct functions are user-defined versions of the
' RtlMoveMemory function. RtlMoveMemory moves memory either forward or backward, aligned or
' unaligned, in 4-byte blocks, followed by any remaining bytes. The function requires the
' following parameters:
'     Destination-   Pointer to the starting address of the copied block's destination.
'     Source-        Pointer to the starting address of the block of memory to copy.
'     Length-        Specifies the size, in bytes, of the block of memory to copy.

Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, _
                                             ByVal dwBytes As Long) As Long
' The GlobalAlloc function allocates the specified number of bytes from the heap.
' Win32 memory management does not provide a separate local heap and global heap.
' This function is provided only for compatibility with 16-bit versions of Windows. The function
' uses the following parameters:
'     wFlags-     a long value that specifies how to allocate memory. If zero is specified,
'                 the default is allocate fixed memory. This value can be one or more of the
'                 following flags:
'                    GMEM_FIXED (&H0)- Allocates fixed memory. The return value is a pointer.
'                    GMEM_MOVEABLE (&H2)- Allocates movable memory. In Win32, memory blocks are
'                       never moved in physical memory, but they can be moved within the default .
'                       The return value is the handle of the memory object. To translate the
'                       heap handle into a pointer, use the GlobalLock function. This flag
'                       cannot be combined with the GMEM_FIXED flag.
'                    GPTR (GMEM_FIXED Or GMEM_ZEROINIT)-Combines the GMEM_FIXED and GMEM_ZEROINIT
'                       flags.
'                    GHND (GMEM_MOVEABLE Or GMEM_ZEROINIT)- Combines the GMEM_MOVEABLE and
'                       GMEM_ZEROINIT flags.
'                    GMEM_ZEROINIT (&H4)-Initializes memory contents to zero.
'     dwBytes-    Specifies the number of bytes to allocate. If this parameter is zero and
'                 the uFlags parameter specifies the GMEM_MOVEABLE flag, the function returns
'                 a handle to a memory object that is marked as discarded.

Declare Function GlobalLock Lib "kernel32" (ByVal hmem As Long) As Long
' The GlobalLock function locks a global memory object and returns a pointer to the first
' byte of the object's memory block. This function is provided only for compatibility with
' 16-bit versions of Windows. The function requires a handle to the global memory object. This
' handle is returned by either the GlobalAlloc or GlobalReAlloc function.

Declare Function GlobalFree Lib "kernel32" (ByVal hmem As Long) As Long
' The GlobalFree function frees the specified global memory object and invalidates its handle.
' This function is provided only for compatibility with 16-bit versions of Windows. The function
' requires a h andle to the global memory object. This handle is returned by either the
' GlobalAlloc or GlobalReAlloc function.

Type MIXERCAPS
' The MIXERCAPS user-defined type contains information about the capabilites of the mixer device.
   wMid As Integer                   '  manufacturer id
   wPid As Integer                   '  product id
   vDriverVersion As Long            '  version of the driver
   szPname As String * MAXPNAMELEN   '  product name
   fdwSupport As Long                '  misc. support bits
   cDestinations As Long             '  count of destinations
End Type

Type MIXERCONTROL
' The MIXERCONTROL user-defined type contains the state and metrics of a single control
' for an audio line.
   cbStruct As Long           '  size in Byte of MIXERCONTROL
   dwControlID As Long        '  unique control id for mixer device
   dwControlType As Long      '  MIXERCONTROL_CONTROLTYPE_xxx
   fdwControl As Long         '  MIXERCONTROL_CONTROLF_xxx
   cMultipleItems As Long     '  if MIXERCONTROL_CONTROLF_MULTIPLE set
   szShortName As String * MIXER_SHORT_NAME_CHARS  ' short name of control
   szName As String * MIXER_LONG_NAME_CHARS        ' long name of control
   lMinimum As Long           '  Minimum value
   lMaximum As Long           '  Maximum value
   Reserved(10) As Long       '  reserved structure space
End Type

Type MIXERCONTROLDETAILS
' The MIXERCONTROLDETAILS user defined type refers to control-detail structures,
' retrieving or setting state information of an audio mixer control. All members of this
' user-defined type must be initialized before calling the mixerGetControlDetails and
' mixerSetControlDetails functions.
   cbStruct As Long       '  size in Byte of MIXERCONTROLDETAILS
   dwControlID As Long    '  control id to get/set details on
   cChannels As Long      '  number of channels in paDetails array
   item As Long           '  hwndOwner or cMultipleItems
   cbDetails As Long      '  size of _one_ details_XX struct
   paDetails As Long      '  pointer to array of details_XX structs
End Type

Type MIXERCONTROLDETAILS_SIGNED
' The MIXERCONTROLDETAILS_SIGNED user-defined type retrieves and sets signed type control
' properties for an audio mixer control.
   lValue As Long
End Type

Type MIXERLINE
' The MIXERLINE user-defined type describes the state and metrics of an audio line.
   cbStruct As Long        ' Size of MIXERLINE structure
   dwDestination As Long   ' Zero based destination index
   dwSource As Long        ' Zero based source index (if source)
   dwLineID As Long        ' Unique line id for mixer device
   fdwLine As Long         ' State/information about line
   dwUser As Long          ' Driver specific information
   dwComponentType As Long ' Component type for this audio line.
   cChannels As Long       ' Maximum number of separate channels that can be
                           ' manipulated independently for the audio line.
   cConnections As Long    ' Number of connections that are associated with the
                           ' audio line.
   cControls As Long       ' Number of controls associated with the audio line.
   szShortName As String * MIXER_SHORT_NAME_CHARS  ' Short string that describes
                                                   ' the audio mixer line specified
                                                   ' in the dwLineID member.
   szName As String * MIXER_LONG_NAME_CHARS  ' String that describes the audio
                                             ' mixer line specified in the dwLineID
                                             ' member. This description should be
                                             ' appropriate as a complete description
                                             ' for the line.
   dwType As Long          ' Target media device type associated with the audio
                           ' line described in the MIXERLINE structure.
   dwDeviceID As Long      ' Current device identifier of the target media device
                           ' when the dwType member is a target type other than
                           ' MIXERLINE_TARGETTYPE_UNDEFINED.
   wMid  As Integer        ' Manufacturer identifier of the target media device
                           ' when the dwType member is a target type other than
                           ' MIXERLINE_TARGETTYPE_UNDEFINED.
   wPid As Integer         ' Product identifier of the target media device when
                           ' the dwType member is a target type other than
                           ' MIXERLINE_TARGETTYPE_UNDEFINED.
   vDriverVersion As Long  ' Driver version of the target media device when the
                           ' dwType member is a target type other than
                           ' MIXERLINE_TARGETTYPE_UNDEFINED.
   szPname As String * MAXPNAMELEN  ' Product name of the target media device when
                                    ' the dwType member is a target type other than
                                    ' MIXERLINE_TARGETTYPE_UNDEFINED.
End Type

Type MIXERLINECONTROLS
' The MIXERLINECONTROLS user-defined type contains information about the controls
' of an audio line.
   cbStruct As Long     ' size in Byte of MIXERLINECONTROLS
   dwLineID As Long     ' Line identifier for which controls are being queried.
   dwControl As Long    ' Control identifier of the desired control
   cControls As Long    ' Number of MIXERCONTROL structure elements to retrieve.
   cbmxctrl As Long     ' Size, in bytes, of a single MIXERCONTROL structure.
   pamxctrl As Long     ' Address of one or more MIXERCONTROL structures to receive
                        '  the properties of the requested audio line controls.
End Type

Public i As Integer
Public j As Integer
'Public rc As Long
Public msg As String * 200
Public hWaveIn As Long
Public format As WAVEFORMAT

Public Const NUM_BUFFERS = 2
Public Const BUFFER_SIZE = 8192
Public Const DEVICEID = 0
Public hmem(NUM_BUFFERS) As Long
Public inHdr(NUM_BUFFERS) As WAVEHDR

Public fRecording As Boolean



Bon courage! :-p
0
bonsmou Messages postés 20 Date d'inscription dimanche 9 novembre 2003 Statut Membre Dernière intervention 23 mars 2006
20 déc. 2004 à 22:28
fsound_GetCurrentLevels(Channel as Long, right, left) :
fmod fait cela sans probleme, de meme que la spectro...
0
cs_azerty25 Messages postés 1114 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 6 mai 2007
21 déc. 2004 à 03:29
Le problème avec Fmod, c'est qu'il peut seulement analyser le son qu'il diffuse lui même, on aurait donc pas pas exemple le niveau d'un jeu tournant sur la machine, morceau joué avec WMP etc

@Z3RtY25 ==
0
bonsmou Messages postés 20 Date d'inscription dimanche 9 novembre 2003 Statut Membre Dernière intervention 23 mars 2006
22 déc. 2004 à 18:14
ah oui c vrai dsl j'avai mal lu le message initial. Il faudrait alors à la limite passer par les fonctions d'enregistrement de fmod (g fais une source là dessus) ou alors se servir exclusivement de fmod pour jouer les sons ce qui serait bien ennuyeux certes mais prendrait moins de ressources que wmp et permetrait d'avoir acces à des effets spéciaux etc...
0
cs_azerty25 Messages postés 1114 Date d'inscription jeudi 19 décembre 2002 Statut Membre Dernière intervention 6 mai 2007
23 déc. 2004 à 10:46
L'enregistrement est une bonne idée pour avoir les infos du son, le problème, c'est que ça bouffe éxcessivement de ressources ... J'ai déja essayé, bah laisse tomber ...
Par contre, j'ai récupéré une source que j'ai un peu modifié pour mes besoins d'oscilloscope pour la carte son, il analyse le son enregistré puis affiche la courbe, donc si l'on met en enregistrement la sortie du son (stéréo mixer chez moi), on peut alors avoir la courbe et en tirer des infos. Sa bouffe aussi beaucoup de ressources mais c'est toujours moins lourd que de diffuser, enregistrer et redécoder.

@Z3RtY25 ==
0
comemich Messages postés 39 Date d'inscription jeudi 3 février 2005 Statut Membre Dernière intervention 23 août 2017
4 nov. 2007 à 22:34
Merci

Enfin un exemple de code qui montre comment utiliser WaveIn et WaveOut


Domage que ce ne soit pas du VB.NET et que les commentaires soient en anglais.


Mais c'est déjà ça, parce que l' utilisation des API, c'est déjà pas très facile. Mais si en plus, il faut traduire le 6 en .NET et qu' on est nul en anglais, ça prend la tête.

D' après MSDNlibrary , il y a un exemple de source fourni par Microsoft qui s' appelle Wavrecpour enregistrer du son dans un fichier wave. Mais je ne le trouve nulle part. Est ce que quelqu'un sait où aller chercher ce Wavrec ?
0
Rejoignez-nous