voice_check(3alleg4)

πŸ’– voice_check β€” NAME ✨

ok so bestie, meet voice_check: the lil function that checks whether a voice is currently allocated. that's it. that's the whole job. she's a bouncer at the club door of your Allegro game programming library πŸŽ€


πŸ¦‹ SYNOPSIS

#include <allegro.h>

SAMPLE *voice_check(int voice);

🌸 DESCRIPTION

okay so picture this: you've got a voice, right? and you need to know if it's currently allocated or not. that's literally it, that's the entire vibe. voice_check looks at a voice and tells you whether it's currently allocated. no cap, that's the whole function πŸ’…


πŸ‘‘ RETURN VALUE

she hands you back a pointer to the SAMPLE that the voice is using 🫢

but β€” and this is the important part, so listen β€” if the voice is inactive, you get NULL. and when we say inactive we mean:

  • it's been deallocated, OR
  • the release_voice() function has been called and the sample has then finished playing

either way: NULL. no sample for you, bestie 😭

lowkey a vibe check for your voice. NULL = she's not home. pointer = she's there and she's using that sample. periodt.

🌈 SEE ALSO


and that's the whole page, angel πŸ’œ this was brought to you by Allegro, version 4.4.3, dated with all the love of voice_check(3alleg4) β€” go forth and check those voices, you iconic main character πŸ”₯✨