shows an example of changing the 32- bit floating point codec to consume little endian format.
Listing 6 Changing the 32 bit floating point codec to consume little endian format
void *atoms;
err = CreateAudioAtomsList(&atoms, k32BitFormat, false);
if (err != noErr) return (err);
err = SndSetInfo(chan, siDecompressionParams, atoms);
Certain sound compression components can show a dialog of options. To determine if the codec supports a dialog, use the SoundComponentGetInfo function with the siOptionsDialog selector. It will return a 16 bit value, with any non-zero value meaning TRUE .
If you use the SoundComponentSetInfo function, the codec will show the dialog and change its settings accordingly, as shown in Listing 7 > . For example, the two floating point and the two new 24 and 32 bit integer codecs can show a dialog that allows the user to specify big or little endian. You can also change a compressor's setting using the siCompressionParams selector.
Listing 7 Using the SoundComponentSetInfo function to show the dialog of options
short hasDialog;
err = SoundComponentGetInfo(compressor, nil, siOptionsDialog, &hasDialog);
if (err != noErr) return (err);
if (hasDialog)
{
err = SoundComponentSetInfo(compressor, nil, siOptionsDialog, nil);
if (err != noErr) return (err);
}
| Previous | Chapter Contents | Chapter Top | Next |