setRawCallback method
- Pointer<
NativeFunction< cb,MixTrackMixCallback> > - Pointer<
NativeType> userdata
Set a callback that fires when a MIX_Track has initial decoded audio.
As a track needs to mix more data, it pulls from its input (a MIX_Audio, an SDL_AudioStream, etc). This input might be a compressed file format, like MP3, so a little more data is uncompressed from it.
Once the track has PCM data to start operating on, it can fire a callback before any changes to the raw PCM input have happened. This lets an app view the data before it has gone through transformations such as gain, 3D positioning, fading, etc. It can also change the data in any way it pleases during this callback, and the mixer will continue as if this data came directly from the input.
Each track has its own unique raw callback.
Passing a NULL callback here is legal; it disables this track's callback.
\param track the track to assign this callback to. \param cb the function to call when the track mixes. May be NULL. \param userdata an opaque pointer provided to the callback for its own personal use. \returns true on success or false on failure; call SDL_GetError() for more information.
\since This function is available since SDL_mixer 3.0.0.
\sa MIX_TrackMixCallback \sa MIX_SetTrackCookedCallback
extern SDL_DECLSPEC bool SDLCALL MIX_SetTrackRawCallback(MIX_Track *track, MIX_TrackMixCallback cb, void *userdata)
{@category mixer}
Implementation
bool setRawCallback(
Pointer<NativeFunction<MixTrackMixCallback>> cb,
Pointer<NativeType> userdata,
) => mixSetTrackRawCallback(this, cb, userdata);