Home Units Hierarchy Routines All identifiers

Class unaWaveOutDevice

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaWaveOutDevice = class(unaWaveDevice)

Description

Use this class to playback PCM audio stream. deviceID parameter used to construct instance of this class can be from 0 to unaWaveOutDevice.getDeviceCount() - 1, or you can use WAVE_MAPPER value instead.

After opening the device feed periodically input stream by calling write() method. If device is unable to load next chunk when needed it can produce a chunk of "silence" and feed it automatically to hardware. Use autoFeed property to enable/disable this behavior.

Hierarchy

Overview

Methods

Public constructor create(deviceID: uint = WAVE_MAPPER; mapped: bool = false; direct: bool = false; overNum: unsigned = 0);
Public function formatChoose(var format: pWAVEFORMATEX; const title: wString = ''; style: unsigned = ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT; enumFlag: unsigned = ACM_FORMATENUMF_HARDWARE + ACM_FORMATENUMF_OUTPUT; enumFormat: pWAVEFORMATEX = nil): MMRESULT;
Public class function getCaps(deviceID: uint; var caps: WAVEOUTCAPSW): bool; overload;
Public class function getDeviceCount(): unsigned;
Public class function getErrorText(errorCode: MMRESULT): string;
Public function getOutCaps(): pWAVEOUTCAPSW;
Protected function addHeader(header: unaWaveHeader): MMRESULT; override;
Protected function afterOpen(): MMRESULT; override;
Protected function doClose(timeout: tTimeout = 1): MMRESULT; override;
Protected function doGetErrorText(errorCode: MMRESULT): string; override;
Protected function doGetPosition(): int64; override;
Protected function doOpen(flags: uint): MMRESULT; override;
Protected function doWrite(buf: pointer; size: unsigned): unsigned; override;
Protected function flush2(waitForComplete: bool = true): bool; override;
Protected function formatChooseDef2(var format: pWAVEFORMATEX): MMRESULT; override;
Protected function getMasterIsSrc2(): bool; override;
Protected function onHeaderDone(header: unaWaveHeader; wakeUpByHeaderDone: bool): bool; override;
Protected function prepareHeader(header: pointer): MMRESULT; override;
Protected function unprepareHeader(header: pointer): MMRESULT; override;
Public procedure AfterConstruction(); override;
Public procedure BeforeDestruction(); override;
Protected procedure startIn(); override;
Protected procedure startOut(); override;

Properties

Protected property awaitingPrefill: bool read f_awaitingPrefill;
Public property handle;
Public property jitterRepeat: bool read f_jitterRepeat write f_jitterRepeat;
Public property onAfterChunkDone: unaWaveDataEvent read f_onACD write f_onACD;
Public property onAfterChunkFeed: unaWaveDataEvent read f_onACF write f_onACF;
Public property outOfData: int64 read f_outOfData;
Public property pitch: unsigned read getPitch write setPitch;
Public property playbackRate: unsigned read getPlaybackRate write setPlaybackRate;
Public property smoothStartup: bool read f_smoothStartup write f_smoothStartup;
Public property volume: unsigned read getDeviceVolume write setDeviceVolume;

Description

Methods

Public constructor create(deviceID: uint = WAVE_MAPPER; mapped: bool = false; direct: bool = false; overNum: unsigned = 0);
 
Public function formatChoose(var format: pWAVEFORMATEX; const title: wString = ''; style: unsigned = ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT; enumFlag: unsigned = ACM_FORMATENUMF_HARDWARE + ACM_FORMATENUMF_OUTPUT; enumFormat: pWAVEFORMATEX = nil): MMRESULT;

Displays format selection dialog.

Public class function getCaps(deviceID: uint; var caps: WAVEOUTCAPSW): bool; overload;

MME only.

Returns

device caps.

Public class function getDeviceCount(): unsigned;

MME only.

Returns

device caps.

Public class function getErrorText(errorCode: MMRESULT): string;

MME only.

Returns

device caps.

Public function getOutCaps(): pWAVEOUTCAPSW;

MME only.

Returns

device caps.

Protected function addHeader(header: unaWaveHeader): MMRESULT; override;
 
Protected function afterOpen(): MMRESULT; override;
 
Protected function doClose(timeout: tTimeout = 1): MMRESULT; override;
 
Protected function doGetErrorText(errorCode: MMRESULT): string; override;
 
Protected function doGetPosition(): int64; override;
 
Protected function doOpen(flags: uint): MMRESULT; override;
 
Protected function doWrite(buf: pointer; size: unsigned): unsigned; override;

Passes data to waweout buffers.

Protected function flush2(waitForComplete: bool = true): bool; override;

Flushes all data pending to be played back.

Protected function formatChooseDef2(var format: pWAVEFORMATEX): MMRESULT; override;

Displays a format choose dialog. Reallocates (if necessary) the given format.

Protected function getMasterIsSrc2(): bool; override;

Returns true.

Protected function onHeaderDone(header: unaWaveHeader; wakeUpByHeaderDone: bool): bool; override;
 
Protected function prepareHeader(header: pointer): MMRESULT; override;
 
Protected function unprepareHeader(header: pointer): MMRESULT; override;
 
Public procedure AfterConstruction(); override;

Allocates resources.

Public procedure BeforeDestruction(); override;

Releases resources.

Protected procedure startIn(); override;
 
Protected procedure startOut(); override;
 

Properties

Protected property awaitingPrefill: bool read f_awaitingPrefill;
 
Public property handle;

WinAPI MME handle

Public property jitterRepeat: bool read f_jitterRepeat write f_jitterRepeat;

If True (default), when out of buffers will repeat last chunk several times until WaveOut has enough buffers for playback (but no more than 5 times). If False, no chunks will be repeated.

Public property onAfterChunkDone: unaWaveDataEvent read f_onACD write f_onACD;

Fires every time chunk was just played out by wave-out device.

Public property onAfterChunkFeed: unaWaveDataEvent read f_onACF write f_onACF;

Fires every time new chunk was feed to wave-out device.

Public property outOfData: int64 read f_outOfData;

Amount of audio data which appear too late to be played back in real time.

Public property pitch: unsigned read getPitch write setPitch;

Not supported yet.

Public property playbackRate: unsigned read getPlaybackRate write setPlaybackRate;

Not supported yet.

Public property smoothStartup: bool read f_smoothStartup write f_smoothStartup;

If True (default), when out of buffers (or during startup) WaveOut be paused till c_waveOut_unpause_after buffers are prepared for playback. If False, playback will start immediately.

Public property volume: unsigned read getDeviceVolume write setDeviceVolume;

Not supported yet. Use getVolume() instead.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09