MIX_CreateTrack(3)

πŸ“¦
version 3.2.4 Β· 2 versions
, in fedora 44

πŸ’– MIX_CreateTrack(3) β€” the SDL_mixer3 glow-up ✨

okay so bestie, this is a page from SDL_mixer3 FUNCTIONS and honestly? it's giving main character energy for your audio setup πŸŽ€


✨ NAME ✨

MIX_CreateTrack β€” create a new track on a mixer. that's it, that's the whole job πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3_mixer/SDL_mixer.h>

MIX_Track * MIX_CreateTrack(MIX_Mixer *mixer);

like, one line in, one pointer out. slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

so a track is basically one single source of audio. that's its whole thing. and then every track that's currently playing gets processed and mixed all together into the final output that comes out of the mixer. the way that they all just become the vibe together?? iconic 🌈

and here's the tea: there are no limits to how many tracks you can create β€” like, none, zero, go wild β€” except obviously you can run out of memory, which, rude 🫠. but in normal practice (read: real life), you keep a small number of tracks and reuse them between all the loaded audio as appropriate. lowkey efficient, highkey smart.

⚠️ tracks are unique to a specific MIX_Mixer and they can't be transferred between them. no trading, no sharing, no rehoming. it belongs to that mixer fr fr πŸ’€

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • mixer β€” the mixer you want to create this track on. that's the one. the chosen one. 🫢

πŸ’œ RETURN VALUE πŸ’œ

returns a brand new MIX_Track on success β€” yay!! πŸŽ‰ β€” or NULL on error 😭. and if it's the sad NULL path, call SDL_GetError() for more informations. (their spelling, not mine, bestie, we respect the original) ✨


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. any. thread. go off, multithreaded queen πŸ‘‘


⭐ AVAILABILITY ⭐

this function has been available since SDL_mixer 3.0.0. old enough to be iconic, young enough to still be relevant πŸ’–


πŸ’… SEE ALSO πŸ’…

  • MIX_DestroyTrack(3) β€” because what goes up must eventually get cleaned up, and we do NOT leak memory in this house πŸ“

okay that's the whole page!! go make some tracks, bestie, you're gonna ate πŸ’–βœ¨πŸŒΈ

xoxo, this manual page was brought to you by SDL_mixer 3.2.4, dated and formatted in the classic SDL_mixer style β€” until next time, mwah πŸŽ€πŸ’‹

πŸ“¦ where this page comes from