al_set_sam...stance_pan(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

🎧 al_set_sample_instance_pan β€” Allegro 5 API 🎧

okay bestie, welcome to the Library Functions Manual corner of the Allegro universe ✨ this page is all about setting the pan value on a sample instance, and it’s lowkey a whole vibe πŸ¦‹

🌸 NAME 🌸

al_set_sample_instance_pan β€” Allegro 5 API πŸ’–

✨ SYNOPSIS ✨

#include <allegro5/allegro_audio.h>

bool al_set_sample_instance_pan(ALLEGRO_SAMPLE_INSTANCE *spl, float val)

πŸ’… DESCRIPTION πŸ’…

So you’re setting the pan value on a sample instance. Here’s the vibe check on the numbers, bestie:

  • -1.0 β€” play the sample only through the left speaker 🫢
  • +1.0 β€” play it only through the right speaker 🌈
  • 0.0 β€” the sample is centre balanced βš–οΈ

There’s also the special value ALLEGRO_AUDIO_PAN_NONE(3), which disables panning and plays the sample at its original level. Heads up: that will be louder than a pan value of 0.0 πŸ”₯

Note: panning samples with more than two channels doesn’t work yet 😭

It returns true on success and false on failure. It will fail if the sample instance is attached directly to a voice πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’– cute sign-off time: source/version is the Allegro reference manual, page al_set_sam...stance_pan(3) β€” and there’s no date in this footer, so no cap, I’m not making one up πŸ™ˆ periodt πŸ’…

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms