Waveoutopen function introduction

zhaozj2021-02-16  88

(from msdn) This function opens a given waveform audio output device for playback. (The waveOutOpen function opens the given waveform-audio output device for playback) URL: http: //msdn.microsoft.com/library/default.asp url = / library / en-us / multimed / htm / _win32_waveoutunprepareheader.asp?

The prototype is as follows: MmResult Waveoutopen (lphwaveout phwo, uint_ptr udeviceid, lpwaveformatex pwfx, dword_ptr dwcallback, dword_ptr dwcallbackinstance, dword fdwopen);

Paramters: PHWO A buffer pointing to the receiving waveform audio output device. Different handles (Identify

The device is called another waveform device output device. If FDWOPEN is set to Wave_FORMAT_QUER

Y, then this parameter may be NULL. UdevideID will be opened by the ID of the waveform audio output device, which can be a device ID, or

It is an open waveform audio input device handle, you can use the following value to replace: Value meaning WAVE_MAPPER This function selects a waveform audio output device capable of playing a given format

PWFX a pointer to the WAVEFormatex structure pointing to the audio data format that will be sent to the device, you can free this structure When you pass it to the Waveoutopen function;

DWCallback It points to a specific Callback function, event handle, window handle, or one will be in waveform

Audio playback to handle the thread ID of the call to handle the message related to the playback progress, if no Call is required

The Back function can be set to 0. For more information, please see WaveoutProc

DWCallbackStance is passed to user instance data of the Callback process. If it is a window Callback process, this parameter is not (set to 0) FWOpen to open the logo of the device (Flags), which define the following: Value meaning callback_event dwcallback parameter bar is the event handle Callback_function dwcallback parameter bar is the Callback process address Callback_null default Setting, ie there is no Callback process callback_thread dwcallback parameter bar is the thread ID callback_window dwcallback parameter bar is the window handle WAVE_ALLOWSYNC If the item is set, a synchronized loading

Set can be opened. If this item is not used when opening a synchronous driver, the device will fail. Wave_format_direct If the item is set, The ACM Driver

Does Not Perform Conversions on The Audio Data. Wave_Format_Query If the item is set, Waveoutopen inquiry

Ask the device to determine if a given format is supported, but the device is actually not opened. Wave_mapped This item is set to the udeviceId parameter representation

A waveform device mapped by an acoustic wave mapping device.

Return Value: returns MMSYSERR_NOERROR successful, otherwise the following values: MMSYSERR_ALLOCATED indicates that the resource exists MMSYSERR_BADDEVICEID apparatus ID departing from the scope MMSYSERR_NODRIVER no driving MMSYSERR_NOMEM not allocate memory WAVERR_BADFORMAT attempt to open format WAVERR_SYNC means an unsupported be synchronized, but waveOutOpen

No Wave_AllowSync calls are available. Note: Waveoutgetnumdevs

The function determines the number of output devices in the current system. If the udeviceic parameter item is a device ID,

It will represent the number of 0 to total, WAAVE_MAPPER constants can also be used as device IDs. The structure referred to in PWFC can be extended to special information that contains certain data formats, for example,

In PCM data, an extra unit

The type used to indicate the number of sampling. In this case, use the PCMWAVEFORAMT structure. For other

Format, with a WaveFormatex structure to indicate additional data lengths. If you choose a window or thread to receive Callback information, the following information will

Will be sent to the window handling function to indicate the waveform audio output process: mm_wom_open

, MM_WOM_CLOSE, and MM_WOM_DONE, if you choose a function to receive Callback information, the following information will be passed

To the function, the waveform audio output process is displayed: wom_open, wom_close, wom_done. Requirements:

Windows NT / 2000 / XP: Included in Windows NT 3.1 and Later. Windows 95/98 / Me: Included in Windows 95 And Later. Header: Declared In MMSystem.h; include Windows.h. Library: Use Winmm.lib. See : Waveform Audio, Waveform Functions, WaveFormatex,

WaveoutGetnumdevs, WaveoutProc, PCMWAVEFORMAT, MM_WOM_OPEN,

MM_WOM_CLOSE, MM_WOM_DONE

转载请注明原文地址:https://www.9cbs.com/read-13373.html

New Post(0)