What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |
The following selector for the SoundComponentGetInfo function is used by QuickTime to retrieve the sound latency:
Retrieves the audio latency from the specified sound output component.
#define siOutputLatency `olte'The following code snippet shows an example implementation of this selector:
static pascal ComponentResult mySoundGetInfo(SoundComponentGlobalsPtr globals, SoundSource
sourceID, OSType selector, void *infoPtr)
{
ComponentResult result = noErr;
PrefStructPtr prefsPtr;
prefsPtr = *(globals->prefsHandle);
switch (selector) {
case siSampleSize: // return current sample size
*((short *) infoPtr) = (short)prefsPtr->sampleSize;
break;
case siOutputLatency: // return the sound output
latency
// in this example, 25 ms
if (infoPtr != nil) {
infoPtr->value.hi = 0;
infoPtr->value.lo = 25; // sound latency
infoPtr->scale = 1000; // 1 ms scale
infoPtr->base = nil;
}
break;
. . .
}What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |