al_set_audio_stream_pan(3alleg5)

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

✨ NAME ✨

al_set_audio_stream_pan β€” Allegro 5 API, bestie πŸ’– (that's the 3alleg5 manual, if you were wondering where you wandered into)


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_audio.h>

bool al_set_audio_stream_pan(ALLEGRO_AUDIO_STREAM *stream, float val)

πŸ’… DESCRIPTION πŸ’…

Okay so this one sets the pan value on an audio stream. Pan = where the sound sits in your headphones, and it is literally the main character of this function.

Here's the tea on the values:

  • -1.0 β€” stream plays only through the left speaker 🎧
  • +1.0 β€” stream plays only through the right speaker 🎧
  • 0.0 β€” the sample is centre balanced, dead middle, balanced queen πŸ‘‘

And then there's a special value: ALLEGRO_AUDIO_PAN_NONE(3alleg5). That one disables panning entirely and plays the stream at its original level. Heads up though β€” that will be louder than a pan value of 0.0. No cap.

It returns true on success and false on failure. And it will fail if the audio stream is attached directly to a voice. So if it's giving failure, check that first, fr fr 😭


πŸ‘€ SEE ALSO πŸ‘€


That's the whole vibe, bestie 🫢 β€” go forth and pan responsibly. This was the Allegro reference manual, page al_set_audio_stream_pan(3alleg5). Mwah, slay, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from