Inside Macintosh: QuickTime Reference

| Previous | Chapter Contents | Chapter Top | Next |

Writing the SoundConverterFillBufferData Routine

If you call SoundConverterFillBuffer, you must provide a callback routine that provides the source data for the conversion. This is the SoundConverterFillBufferData routine whose prototype is:

pascal Boolean    SoundConverterFillBufferDataProc( 
                        SoundComponentDataPtr*    data,
                        void*                     refCon);

The SoundConverterFillBufferDataProc call provides its data by setting the data argument to a pointer to a properly filled out SoundComponentData or ExtendedSoundComponentData structure.

The refCon argument is the same fillbufferDataRefCon passed into SoundConverterFillBuffer.

The SoundConverterFillBufferDataProc tells its caller whether or not it provided any data through the Boolean return value.

The data provided by the SoundConverterFillBufferDataProc is not considered consumed until either the SoundConverterFillBufferDataProc is called again or SoundConverterEndConversion is called. Until those times, the data should be considered "in use" and shouldn't be modified.

Because of the the way the Sound Converter works, the SoundConverterFillBufferDataProc routine may be called several times after returning no data from the previous call. Unless there is actually more data to provide, the SoundConverterFillBufferDataProc routine should continue to return no data.

Note:   The SoundConverterFillBufferDataProc routine, like all Sound Converter-related routines, may be called at interrupt time (if the client of SoundConvertFillBuffer called it at interrupt time), so it should not move or allocate memory.


© 2000 Apple Computer, Inc.

Inside Macintosh: QuickTime Reference

| Previous | Chapter Contents | Chapter Top | Next |