al_create_voice(3)
al_create_voice(3) π
okay bestie, welcome to the Library Functions Manual corner of the Allegro 5 API β¨ this page is all about one lil function that sets up a voice, and no cap itβs giving audio-core main character energy π§π
π NAME π
al_create_voice β Allegro 5 API π«Ά
β¨ SYNOPSIS β¨
#include <allegro5/allegro_audio.h>
ALLEGRO_VOICE *al_create_voice(unsigned int freq,
ALLEGRO_AUDIO_DEPTH depth, ALLEGRO_CHANNEL_CONF chan_conf)
π DESCRIPTION π
okay so what does it do? It creates a voice structure and allocates a voice from the digital sound driver π
The passed frequency (in Hz), sample format, and channel configuration are used as a hint to what kind of data will be sent to the voice. Thatβs the key word, bestie: hint π The underlying sound driver is free to use non-matching values. For example, it may be the native format of the sound hardware. So donβt act surprised if the numbers come back different β thatβs literally allowed π
If a mixer is attached to the voice, the mixer will handle the conversion of all its input streams to the voice format, and care does not have to be taken for this π«Ά However, if you access the voice directly, make sure to not rely on the parameters passed to this function β instead, query the returned voice for the actual settings. Periodt. Thatβs the vibe check π
Reasonable default arguments are:
al_create_voice(44100, ALLEGRO_AUDIO_DEPTH_INT16, ALLEGRO_CHANNEL_CONF_2)
π SEE ALSO π
al_destroy_voice(3)β thatβs the one linked here, bestie π«Ά
π from the Allegro reference manual, al_create_voice(3) β date not listed on this page, and thatβs the whole sign-off vibe, no cap π«Άβ¨
π¦ 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