Many CDs have CD-DA ("Redbook audio") tracks that contain digital audio. These audio tracks can be played using the built-in DAC or the data can be read into the system and streamed to an adapter with DAC hardware KB (for example, ACPA card). For the latter case, the CD-DA Stream Handler DLL is required and acts as the source stream handler.
This handler does not operate fully in a real-time mode, but it must support continuous data streaming. It also does not support synchronization mastering, because of the lack of real-time nature of CD devices.
This handler operates on the specific CD addresses. Most CD-DA do not have data in approximately the first 2 seconds of the CD, but some discs do. CD-DA tracks can also be placed between other data tracks on mixed-mode disks. Because of this operation, the CD-DA Stream Handler will interpret the absolute beginning of the disc as MMTIME 0. The calling program must query the disc and find where the desired CD-DA track begins and call SpiSeekStream before starting the stream. The CD Audio media control interface driver does this operation for the applications coding to the media control interface.
External Interface Description
The description for the Compact Disc-Digital Audio Stream Handler external interface follows:
File Name
Device Control Blocks
None.
Associate Control Blocks
This handler supports type ACBTYPE_CDDA associate control blocks.
/****************************************************** * CDDASH - CD DA Stream Handler Object ACB ******************************************************/ #define ACBTYPE_CDDA 0x0004L /* Compact disc - digital audio */ typedef struct _acb_CDDA /* acbcdda - CD Assoc. Control Block */ { ULONG ulACBLen; /* Length of structure */ ULONG ulObjType; /* ACB_CDDA */ CHAR bCDDrive; /* CD drive letter */ } ACB_CDDA;
Implicit (EVENT_IMPLICIT_TYPE) Events Supported
The following implicit (EVENT_IMPLICIT_TYPE) events for the Compact Disc-Digital Audio Stream Handler are supported:
The error type will be set in the ulFlag field of the event implicit control block (EVCB). The three types of errors that will be reported are:
An error occurred during streaming but the stream handler, the Sync/Stream Manager or both the stream handler and the Sync/Stream Manager were able to continue streaming.
An error occurred that required the stream to be stopped. The application can restart the stream if appropriate.
A severe error occurred causing the stream handler to stop this stream. The stream can not be restarted. The application must issue an SpiDestroyStream.
The ulStatus field will contain the error code. The possible error codes that can be generated and returned by this stream handler are:
Explicit Events Supported
No explicit events are supported for the Compact Disc-Digital Audio Stream Handler.
Stream Handler Commands Supported
The following stream handler commands (SHC) are supported. Refer to the OS/2 Multimedia Programming Reference for a description of these SHC commands and the error return codes.
Note: A stream requires a file to be opened and associated to the stream before a stream can be started. Reassociating a new drive letter without stopping the stream is not supported.
Possible return codes:
Note: The only data type supported is 16-bit PCM Stereo sampled at 44.1 kHz.
Possible return codes:
Return codes from the following APIs are also returned:
Possible return codes:
Possible return codes:
Possible return codes:
Note: Keep in mind that SEEK will go to the specified address in absolute terms. The absolute address from the beginning of the disc might not be the beginning of the CD-DA music.
Also the seekpoint is granular to the mmtimePerUnit specified in the SPCB.
Possible return codes:
Possible return codes:
Note: This stream handler allows any data type and subtype to be installed.
Possible return codes:
Possible return codes:
Possible return codes:
Base Stream Protocol Control Block Data Types Supported
The Compact Disc-Digital Audio Stream Handler has only 1 base SPCB. It is DATATYPE_WAVEFORM with DataSubType WAVE_FORMAT_4S16. This SPCB has the following defaults:
┌────────────────────┬────────────────────────────────────────┐│SPCB Field │DATATYPE_WAVEFORM Values │ ├────────────────────┼────────────────────────────────────────┤ │ulBufSize │48KB │ ├────────────────────┼────────────────────────────────────────┤ │ulMinBuf │8 │ ├────────────────────┼────────────────────────────────────────┤ │ulMaxBuf │12 │ ├────────────────────┼────────────────────────────────────────┤ │ulSrcStart │1 │ ├────────────────────┼────────────────────────────────────────┤ │ulTgtStart │7 │ ├────────────────────┼────────────────────────────────────────┤ │ulBufFlag │SPCBBUF_FIXEDBUF │ ├────────────────────┼────────────────────────────────────────┤ │ulHandFlag │SPCBHAND_NOSYNC | SPCBHAND_PHYS_SEEK │ ├────────────────────┼────────────────────────────────────────┤ │ulBytesPerUnit │588 │ ├────────────────────┼────────────────────────────────────────┤ │mmtimePerUnit │10 │ └────────────────────┴────────────────────────────────────────┘
Stream Handler Limits
Maximum number of streams (only limited by available memory).