al_create_mixer(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_create_mixer β€” Allegro 5 API πŸ’–

bestie. sit down. we're making a mixer today and it's gonna be iconic. this is page al_create_mixer from the Allegro 5 API, and no cap, it's lowkey the moment everything starts. πŸŽ€


✨ SYNOPSIS ✨

#include <allegro5/allegro_audio.h>

ALLEGRO_MIXER *al_create_mixer(unsigned int freq,
   ALLEGRO_AUDIO_DEPTH depth, ALLEGRO_CHANNEL_CONF chan_conf)

🌸 DESCRIPTION 🌸

okay so picture this: al_create_mixer makes you a mixer. and what is a mixer for?? it's the little hangout spot where you attach your sample instances, your audio streams, or even other mixers β€” like, mixers attaching to mixers, it's giving family reunion 🫢

it mixes everything into a buffer at the frequency you asked for (that's in Hz) and at the channel count you asked for. periodt.

now the tea on audio depths β˜• β€” the only supported ones are:

  • ALLEGRO_AUDIO_DEPTH_FLOAT32
  • ALLEGRO_AUDIO_DEPTH_INT16

and heads up, ALLEGRO_AUDIO_DEPTH_INT16 is (not yet complete). so like. it's there but it's not fully cooked yet 😭 don't come for me, that's just what the page says.

also, real talk: a mixer on its own is literally producing nothing. it's just vibing. to actually get any output you have to attach it to a voice using al_attach_mixer_to_voice(3alleg5). no voice, no sound. that's the vibe check. πŸ’…

if you're like "bestie what args do i even pass", the reasonable defaults are:

al_create_mixer(44100, ALLEGRO_AUDIO_DEPTH_FLOAT32, ALLEGRO_CHANNEL_CONF_2)

slay. and the return? true on success, false on error. simple as that, fr fr.


πŸ‘‘ SEE ALSO πŸ‘‘


k that's the whole page bestie, you ate it πŸ“ this came straight out of the Allegro reference manual β€” the al_create_mixer(3alleg5) page, that's the source and the version and everything, mwah πŸ’œβœ¨ go make some noise.

πŸ“¦ where this page comes from