What's New in QuickTime 4.1

| Previous | Chapter Contents | Chapter Top | Next |

ExtendedScheduledSoundHeader

The extended forms of the SoundComponentData and SoundParamBlock records are all with which a sound decompressor implementer need be concerned.

However, to allow for the passing of these extended fields to the sound channel, a new flavor of ScheduledSoundHeader is introduced.

This is called an ExtendedScheduledSoundHeader . Like the ScheduledSoundHeader , this record is passed as a parameter to the scheduledSoundCmd sound command.

Note
The ScheduledSoundHeader and scheduledSoundCmd are available with Sound Manager 3.3 or later and when QuickTime is installed.

By way of quick review, ScheduledSoundHeader is defined like this:

struct ScheduledSoundHeader {
SoundHeaderUnion u;
long flags;
short reserved;
short callBackParam1;
long callBackParam2;
TimeRecord startTime;
};
typedef struct ScheduledSoundHeader ScheduledSoundHeader;
typedef ScheduledSoundHeader *
ScheduledSoundHeaderPtr;

and consists of the following fields:

u
A SoundHeaderUnion used to pass the audio to the channel.

flags
A set of flags previously defined to be one of the following:

kScheduledSoundDoScheduled = 1 << 0

If set, this indicates that the startTime field holds the time when this buffer should be played.

kScheduledSoundDoCallBack = 1 << 1

If set, this means the callback should be called when the buffer completes. This typically is used to chain buffer playback together.

reserved
Reserved. Set to 0.

callBackParam1
 

callBackParam2
 

These two fields are passed as the parameters to the sound callback associated with the channel.

startTime
A TimeRecord indicating the time that the sound buffer should play. Note that this TimeRecord describes a time in the future.

The sound clock associated with the channel is used to determine when it should be played.

To these fields, extended fields are added. The ExtendedScheduledSoundHeader definition including both older and newer fields is shown as follows:

struct ExtendedScheduledSoundHeader {
SoundHeaderUnion u;
long flags;
short reserved;
short callBackParam1;
long callBackParam2;
TimeRecord startTime;
long recordSize;
long extendedFlags;
long bufferSize;
};
typedef struct ExtendedScheduledSoundHeader ExtendedScheduledSoundHeader;

The extended fields consist of:

recordSize
Holds the size of the field in bytes. Again, in the future this may grow.

extendedFlags Holds the same flags in the extendedFlags as the ExtendedSoundComponentData and
ExtendedSoundParamBlock records already discussed.

bufferSize
The buffer size in bytes. This field is not valid if the extendedFlags field's kExtendedSoundBufferSizeValid flag is clear.

Finally, to determine if a ScheduledSoundHeader is an ExtendedScheduledSoundHeader , you can check for this additional flag in its flags field.

kScheduledSoundExtendedHdr = 1 << 2

If clear, this is a classic ScheduledSoundHeader . If set, this is an ExtendedScheduledSoundHeader and at least contains the recordSize and extendedFlags fields. (It includes a bufferSize field, since this is the first version of an ExtendedScheduledSoundHeader .)


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |