AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

waveInOpen

The waveInOpen function opens the given waveform-audio input device for recording.

VB4-32,5,6
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

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
Winmm

Parameter Information
· phwi
Address filled with a 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
Identifier of the waveform-audio input device to open. It can be either a device identifier or a handle of an open waveform-audio input device.You can use the following flag instead of a device identifier:
WAVE_MAPPER
The function selects a waveform-audio input device capable of recording in the specified format.

· pwfx
Address of a WAVEFORMATEX structure that identifies the desired format for recording waveform-audio data. You can free this structure immediately after waveInOpen returns.

· dwCallback
Address of a fixed callback function, 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.

· dwCallbackInstance
User-instance data passed to the callback mechanism. This parameter is not used with the window callback mechanism.

· fdwOpen
Flags for opening the device. The following values are defined:
CALLBACK_EVENT
The dwCallback parameter is an event handle.
CALLBACK_FUNCTION
The dwCallback parameter is a callback procedure address.
CALLBACK_NULL
No callback mechanism. This is the default setting.
CALLBACK_THREAD
The dwCallback parameter is a thread identifier.
CALLBACK_WINDOW
The dwCallback parameter is a window handle.
WAVE_FORMAT_DIRECT
If this flag is specified, the ACM driver does not perform conversions on the audio data.
WAVE_FORMAT_QUERY
The function queries the device to determine whether it supports the given format, but it does not open the device.
WAVE_MAPPED
The uDeviceID parameter specifies a waveform-audio device to be mapped to by the wave mapper.

Return Values
Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following.
MMSYSERR_ALLOCATED Specified resource is already allocated.
MMSYSERR_BADDEVICEID Specified device identifier is out of range.
MMSYSERR_NODRIVER No device driver is present.
MMSYSERR_NOMEM Unable to allocate or lock memory.
WAVERR_BADFORMAT Attempted to open with an unsupported waveform-audio format.

Examples

Related Functions

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/