Previous | Contents | Index |
#include <mme/mme_api.h> MMRESULT waveOutPause(HWAVEOUT hWaveOut) |
The waveOutPause function pauses playback on the specified waveform audio output device. The current playback position is saved. Call the waveOutRestart function to resume playback from the current playback position.Extensions None.Calling the waveOutPause function when the output is already paused has no effect, and the function returns MMSYSERR_NOERROR.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMSYSERR_INVALHANDLE | The specified device handle is invalid. |
MMSYSERR_HANDLEBUSY | The handle hWaveOut is in use on another thread. |
#include <mme/mme_api.h> MMRESULT waveOutReset(HWAVEOUT hWaveOut) |
The waveOutReset function stops playback on a specified waveform audio output device and resets the current position to 0. All pending playback buffers are marked as done and returned to the application via the callback defined in the waveOutOpen function.Extensions None.Before attempting to close a waveform audio output device, call the waveOutReset function to mark all pending buffers as done. Then, call the waveOutClose function to close the device.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMSYSERR_INVALHANDLE | The specified device handle is invalid. |
MMSYSERR_HANDLEBUSY | The handle hWaveOut is in use on another thread. |
#include <mme/mme_api.h> MMRESULT waveOutRestart(HWAVEOUT hWaveOut) |
The waveOutRestart function restarts playback on the specified paused waveform audio output device. Calling the waveOutRestart function when the output is not paused has no effect, and the function returns MMSYSERR_NOERROR.Extensions None.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMSYSERR_INVALHANDLE | The specified device handle is invalid. |
MMSYSERR_HANDLEBUSY | The handle hWaveOut is in use on another thread. |
#include <mme/mme_api.h> MMRESULT waveOutSelectPorts(UINT uClassDeviceID, DWORD dwPortMask); |
DWORD dwPortMask
Specifies one or more ports to be selected.
The waveOutSelectPorts function enables audio data to be output through the ports specified by the dwPortMask parameter. The dwPortMask value is a bit mask; each bit set defines whether the corresponding port is to be selected. Mask values MME_PORTMASK_01 through MME_PORTMASK_32 are defined for use in specifying the port mask value.Extensions The waveOutSelectPorts function is a Compaq extension to the Microsoft multimedia API specification.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMSYSERR_BADDEVICEID | The specified device ID is out of range. |
MMSYSERR_NOTSUPPORTED | This function is not supported for this device. |
MMSYSERR_INVALPARAM | The value of dwPortMask is not valid, or the selection of the ports specified is not supported by this device. |
The Compaq Ensoniq AudioPCI device supports one output port. Port 1 (MME_PORTMASK1) corresponds to the AC97 Line Out signal. Both the headset jack and the lineout jacks are connected to this port. See Also waveInSelectPorts
#include <mme/mme_api.h> MMRESULT waveOutSetVolume(UINT uClassDeviceID, DWORD dwVolume); |
DWORD dwVolume
Specifies the new volume setting. The low-order word contains the
left-channel volume setting, and the high-order word contains the
right-channel setting. A value of 0xFFFF represents full volume and a
value of 0x0000 represents full muting (silence). If a device does not
support both left and right volume control, the low-order word of the
dwVolume argument specifies the volume level and the
high-order word is ignored.
The waveOutSetVolume function sets the current playback volume of the specified waveform audio output device. Not all devices support volume changes. To determine whether the device supports volume control, use the WAVECAPS_VOLUME flag to test the dwSupport field of the WAVEOUTCAPS data structure filled by the waveOutGetDevCaps function.Extensions None.To determine whether the device supports volume control on both the left and right channels, use the WAVECAPS_LRVOLUME flag to test the dwSupport field of the WAVEOUTCAPS data structure filled by the waveOutGetDevCaps function.
Most devices do not support the full 16 bits of volume-level control and do not use the low-order bits of the requested volume setting. For example, for a device that supports 4 bits of volume control, requested volume level values of 0x4000, 0x4fff, and 0x43be produce the same physical volume setting, 0x4000.
The waveOutGetVolume function returns the full 16-bit setting that is set with the waveOutSetVolume function. Volume settings are interpreted logarithmically. This means that the perceived increase in volume is the same when increasing the volume level from 0x5000 to 0x6000 as it is from 0x4000 to 0x5000.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMSYSERR_BADDEVICEID | The specified device ID is out of range. |
MMSYSERR_NODRIVER | The driver is not installed. |
MMSYSERR_NOTSUPPORTED | The function is not supported. |
#include <mme/mme_api.h> MMRESULT waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize); |
LPWAVEHDR lpWaveOutHdr
Specifies a pointer to a WAVEHDR data structure that
contains information about the data block.
The WAVEHDR data structure must be allocated with the mmeAllocMem function before being passed to the waveOutWrite function. See Chapter 2 for more information about the memory allocation functions.
UINT uSize
Specifies the size in bytes of the WAVEHDR data
structure.
The waveOutWrite function sends a data block to the specified waveform audio output device. Unless the device is paused by calling the waveOutPause function, playback begins when the first data block is sent to the device. This buffer is returned to the application via the callback defined in the waveOutOpen function.Extensions None.
Returns MMSYSERR_NOERROR if the function is successful; otherwise, it returns one of the following error codes:
Error Code | Description |
---|---|
MMSYSERR_HANDLEBUSY | The handle hWaveOut is in use on another thread. |
MMSYSERR_INVALHANDLE | The specified device handle is invalid. |
MMSYSERR_UNPREPARED | The lpWaveOutHdr argument is not prepared. |
3.9 Waveform Audio Return Values
This section presents the waveform audio return values or error codes.
Table 3-3 lists the codes that can be returned by one or more of
the waveform audio functions.
Error Code | Description |
---|---|
MMSYSERR_NOERROR | The function completed successfully. |
MMSYSERR_ALLOCATED | The requested exclusive-access device has already been opened for exclusive access by another process or thread. |
MMSYSERR_BADDEVICEID | The specified device ID does not correspond to an existing device. For each device type (Wave In or Wave Out), each existing device has a unique device ID. IDs range from 0 to one less than the total number of available devices of that type. |
MMSYSERR_BADERRNUM | The error number for which information was requested is not recognized. |
MMSYSERR_ERROR | The library or server had an internal error. |
MMSYSERR_HANDLEBUSY | Another process or thread is currently using the specified device handle. |
MMSYSERR_INVALHANDLE | The specified device handle is invalid. The functions waveInOpen and waveOutOpen are the only sources of valid Wave In or Wave Out device handles, and these handles become invalid when passed to waveInClose or waveOutClose . |
MMSYSERR_INVALFLAG | One or more specified flag values are not supported by the specified device. |
MMSYSERR_INVALPARAM | One or more specified parameters are invalid. This error is often caused by NULL pointer values or incorrect parameter sizes. |
MMSYSERR_NOMEM | Unable to allocate or lock memory. |
MMSYSERR_NOTSUPPORTED | The function is not supported by the specified device. |
WAVERR_BADFORMAT | The requested wave audio data format is not supported by the specified device. |
WAVERR_DEVICENOTSHAREABLE | The requested shareable device has already been opened for exclusive access by another process or thread. |
WAVERR_DEVICESHAREABLE | The requested exclusive-access device has already been opened as a shareable device by another process or thread. The device is still available for shareable access. |
WAVERR_STILLPLAYING | The specified device cannot be closed because it still has audio buffers in its processing queue. These buffers can be released by calling waveInReset or waveOutReset . |
WAVERR_UNPREPARED | The specified WAVEHDR data structure has not been prepared. Some devices require all WAVEHDR data structures to be prepared before use. The functions waveInPrepareHeader and waveOutPrepareHeader prepare these structures for use. |
This chapter presents an overview of video capture and playback
services available to applications. An application uses these services
to record and play back video data.
4.1 Video Capture and Playback Services Overview
The video capture and playback library provides low-level video input and output services for multimedia applications. Applications use these services to control the capture and playback of video data.
Video capture is input of video data through the input jack of a video capture device, such as the FullVideo Supreme option module. Video capture is used to input video frames from a video camera, video player, television tuner, or other video device.
Video playback is output of video data through the output jack of a video playback device, such as the FullVideo Supreme option module. Video playback is used to output video frames to an external monitor, a VCR, or other video playback device.
The video capture and playback library provides the interface between client applications and video capture and playback hardware. The library provides the following services:
The following sections provide an overview of video capture and
playback architecture and describe the video capture and playback
services in detail.
4.1.1 Video Capture and Playback Channels
Video capture and playback devices can transfer data through four different channels: External In (VIDEO_EXTERNALIN), External Out (VIDEO_EXTERNALOUT), Video In (VIDEO_IN), and Video Out (VIDEO_OUT). The destination or source of each channel is the video capture and playback hardware.
Figure 4-1 shows the four channels and the frame buffer in a video capture and playback device.
Figure 4-1 Video Capture and Playback Channels and Frame Buffer
In Figure 4-1:
The application controlling the video capture or playback device has the responsibility of allocating the memory used for video capture or playback and for managing the data buffers used for the transfer of video data. To record or play back audio and video simultaneously, the application also controls the audio device used for recording or playing back the audio data. See Chapter 3 for more information about recording and playing back audio data.
Once the video and audio devices capture data, the application is
responsible for any postprocessing of the data. For example, if the
application wants to save the data as an AVI file, it must add the
appropriate headers and create the AVI RIFF structure saved in the disk
file. See Chapter 6 for more information about AVI files.
4.2 Using Video Capture and Playback Services
Video capture and playback services control different types of video capture and playback devices. This section presents general information about using the video capture and playback services.
Previous | Next | Contents | Index |