load_wav(3alleg4)
β¨ NAME β¨
load_wav β bestie, this is the one that loads a sample from a RIFF WAV file π and yeah it's part of the Allegro game programming library, so we're in 3alleg4 territory, iykyk β¨
πΈ SYNOPSIS πΈ
#include <allegro.h>
SAMPLE *load_wav(const char *filename);
π DESCRIPTION π
Okay so, load_wav loads a sample from a RIFF WAV file. That's it, that's the whole vibe. You hand it a filename, it hands you a SAMPLE, main character energy all around π
Like, for example, look at this iconic little snippet:
SAMPLE *sample = load_wav("scream.wav");
if (!sample)
abort_on_error("Couldn't scare user!");
Not us loading "scream.wav" and then bailing with abort_on_error("Couldn't scare user!") if it didn't work π peak comedy, peak engineering, no notes π
π¦ RETURN VALUE π¦
It returns a pointer to the SAMPLE β slay β or NULL if something went wrong π (error vibes only).
Real talk though: remember to free this sample later, because otherwise you get memory leaks and that's not the aesthetic, bestie π«Ά leaks are giving unhandled baggage and we don't do that here.
π SEE ALSO π
load_sample(3alleg4)β the other sample-loading girlie πregister_sample_file_type(3alleg4)β for when you wanna teach Allegro new file type tricks β¨
That's the whole page, fr fr. This came to you from the Allegro manual, version 4.4.3 π mwah, go make something loud ππ§
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms