load_wav(3)
π load_wav(3) π
okay bestie, welcome to the Allegro manual β yes, that Allegro, the game programming library, and today's main character is load_wav.
β¨ NAME β¨
load_wav β loads a sample from a RIFF WAV file. part of the Allegro game programming library. no cap, that's the whole job description π
πΈ SYNOPSIS πΈ
#include <allegro.h>
SAMPLE *load_wav(const char *filename);
π¦ DESCRIPTION π¦
so basically: load_wav loads a sample from a RIFF WAV file. that's it. that's the vibe. one file in, one SAMPLE out π
here's how it looks in the wild, literally:
SAMPLE *sample = load_wav("scream.wav");
if (!sample)
abort_on_error("Couldn't scare user!");
like, you point it at your "scream.wav", and if it hands you back nothing (a whole NULL, rude), you go ahead and abort_on_error with "Couldn't scare user!". iconic error handling tbh π
π RETURN VALUE π
- gives you back a pointer to the
SAMPLEβ slay π - or
NULLif something went wrong π
β οΈ bestie, listen: remember to free this sample later or you'll get memory leaks. the leaks are not cute. free your sample, protect your peace π«Ά
π SEE ALSO π
Allegro, version 4.4.3 β that's the source and the version, mwah, love that for us. thanks for reading bestie, go load some WAVs ππ¦β¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms