|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
void Mix_HookMusic(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg)
udataparameter when it is called.
This sets up a custom music player function. The function will be called with arg passed into the
udata parameter when the mix_func is called. The
stream parameter passes in the audio stream buffer to be filled with
len bytes of music. The music player will then be called automatically when the mixer needs it. Music playing will start as soon as this is called. All the music playing and stopping functions have no effect on music after this. Pause and resume will work. Using a custom music player and the internal music player is not possible, the custom music player takes priority. To stop the custom music player call
NOTE: NEVER call SDL_Mixer functions, nor
SDL_LockAudio, from a callback function.
4.5.14 Mix_SetMusicCMD, 4.5.22 Mix_GetMusicHookData