typedef struct { DWORD startFrame; DWORD numFrames; DWORD maxLen; DWORD len; DWORD status; int startOffset; BYTE buf[1024*1024]; } *PTRACKBUF, FAR *LPTRACKBUF;Description: The TRACKBUF structure is used by ReadCDAudioLBA. It should not be allocated directly, but rather a buffer of the desired size should be allocated and typecast to an LPTRACKBUF -- since TRACKBUF is not actually defined, this section should by all rights be entitled LPTRACKBUF. The amount of memory to allocate is calculated by the following formula: numBytes = (2352 * numFrames) + TRACKBUFEXTRA. TRACKBUFEXTRA is defined in akrip32.h.
startFrame | For calls to ReadCDAudioLBA, this should be set to the first frame to read. Once data has been read, startFrame specifies the LBA of the first frame of valid data in buf. |
numFrames | The number of frames to read, or after data has been read, the number of complete frames contained in buf. |
maxLen | The length of the array buf. |
len | The number of valid bytes actually stored in buf. |
status | The value from SRB_Status from the call to the ASPI manager for the read. |
startOffset | The starting offset of valid data in buf. After a read, this will be set to zero, but after jitter correction, this value may change to indicate the position where data begins in buf. |
buf | The actual audio data itself. |
LPTRACKBUF newTrackBuf( DWORD numFrames ) { LPTRACKBUF t; int numAlloc; numAlloc = (((int)numFrames)*2352) + TRACKBUFEXTRA; t = (LPTRACKBUF)malloc( numAlloc ); if ( !t ) return NULL; t->startFrame = 0; t->numFrames = 0; t->maxLen = numFrames * 2352; t->len = 0; t->status = 0; t->startOffset = 0; return t; }See also: ReadCDAudioLBA