CreateSoundFilePlayer

Creates a SoundFilePlayer data structure to play sound files.

Synopsis

SoundFilePlayer *CreateSoundFilePlayer( int32 NumBuffers,int32 BufSize, void *Buffers[] )

Description

This function creates a SoundFilePlayer data structure and initializes it. A SoundFilePlayer can be used to play several sound files, one at a time. The Buffers argument is a pointer to an array of pointers to preallocated audio data buffers, all the same size. If Buffers is NULL, then this function allocates the memory for you. The memory for this must be of type MEMTYPE_AUDIO.

Arguments

NumBuffers
A value indicating the number of audio data buffers.
BufSize
A value indicating the size of the audio data buffers.
Buffers
A pointer to an array of pointers to preallocated audio data buffers.

Return Value

This function returns a pointer to the SoundFilePlayer data structure if all went well or a NULL if an error occurs.

Implementation

Library call implemented in music.lib V20.

Caveats

Buffer size must be a multiple of the file's block size (see LoadSoundFile() for complete reason).

Associated Files

soundfile.h, music.lib

See Also

OpenSoundFile(), CloseSoundFile(),DeleteSoundFilePlayer() LoadSoundFile(), ReadSoundFile(), RewindSoundFile(), ServiceSoundFile(), StartSoundFile(), StopSoundFile(), UnloadSoundFile()