Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

waveInOpen

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

MMRESULT waveInOpen(

LPHWAVEIN phwi,

UINT uDeviceID,

LPWAVEFORMATEX pwfx,

DWORD dwCallback,

DWORD dwCallbackInstance,

DWORD fdwOpen

);

Parameters

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.

Remarks

Use the waveInGetNumDevs function to determine the number of waveform-audio input devices present on the system. The device identifier specified by uDeviceID varies from zero to one less than the number of devices present. The WAVE_MAPPER constant can also be used as a device identifier.

If you choose to have a window or thread receive callback information, the following messages are sent to the window procedure or thread to indicate the progress of waveform-audio input: MM_WIM_OPEN, MM_WIM_CLOSE, and MM_WIM_DATA.

If you choose to have a function receive callback information, the following messages are sent to the function to indicate the progress of waveform-audio input: WIM_OPEN, WIM_CLOSE, and WIM_DATA.

See Also

WAVEFORMATEX
, waveInGetNumDevs, waveInProc, MM_WIM_OPEN, MM_WIM_CLOSE, MM_WIM_DATA


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2011 Free Tech Secrets ;) greatis just4fun network just4fun