SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]
(This function is part of SDL_mixer, a separate library from SDL.)

MIX_PlayTrack

Start (or restart) mixing a track for playback.

Header File

Defined in <SDL3_mixer/SDL_mixer.h>

Syntax

bool MIX_PlayTrack(MIX_Track *track, SDL_PropertiesID options);

Function Parameters

MIX_Track * track the track to start (or restart) mixing.
SDL_PropertiesID options a set of properties that control playback. May be zero.

Return Value

(bool) Returns true on success, false on error; call SDL_GetError() for details.

Remarks

The track will use whatever input was last assigned to it when playing; an input must be assigned to this track or this function will fail. Inputs are assigned with calls to MIX_SetTrackAudio(), MIX_SetTrackAudioStream(), or MIX_SetTrackIOStream().

If the track is already playing, or paused, this will restart the track with the newly-specified parameters.

As there are several parameters, and more may be added in the future, they are specified with an SDL_PropertiesID. The parameters have reasonable defaults, and specifying a 0 for options will choose defaults for everything.

These are the supported properties:

If this function fails, mixing of this track will not start (or restart, if it was already started).

Thread Safety

It is safe to call this function from any thread.

Version

This function is available since SDL_mixer 3.0.0.

See Also


CategoryAPI, CategoryAPIFunction, CategorySDLMixer


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.