AL_CREATE_AUDIO_RECORDER(3)
π al_create_audio_recorder(3) π
okay so bestie, this page is from the Library Functions Manual, and itβs all about the Allegro 5 API. buckle up, weβre making an audio recorder. ποΈβ¨
πΈ NAME πΈ
al_create_audio_recorder β Allegro 5 API function that creates an audio recorder.
β¨ SYNOPSIS β¨
#include <allegro5/allegro_audio.h>
ALLEGRO_AUDIO_RECORDER *al_create_audio_recorder(size_t fragment_count,
unsigned int samples, unsigned int frequency,
ALLEGRO_AUDIO_DEPTH depth, ALLEGRO_CHANNEL_CONF chan_conf)
π DESCRIPTION π
Creates an audio recorder using the systemβs default recording device. (So if the returned device does not work, try updating the systemβs default recording device β thatβs the whole tip, bestie.)
Allegro will internally buffer several seconds of captured audio with minimal latency. Thereβs a literal dev note right here: (XXX: These settings need to be exposed via config or API calls.) Audio will be copied out of that private buffer into a fragment buffer of the size specified by the samples parameter. Whenever a new fragment is ready an event will be generated. π¦
The total size of the fragment buffer is fragment_count * samples * bytes_per_sample. It is treated as a circular, never ending buffer. If you do not process the information fast enough, it will be overrun. π Because of that, even if you only ever need to process one small fragment at a time, you should still use a large enough value for fragment_count to hold a few seconds of audio.
frequency is the number of samples per second to record. Common values are:
8000β telephone quality speech110252205044100β CD quality music (if 16-bit, stereo)
For maximum compatibility, use a depth of ALLEGRO_AUDIO_DEPTH_UINT8 or ALLEGRO_AUDIO_DEPTH_INT16, and a single (mono) channel.
The recorder will not record until you start it with al_start_audio_recorder(3).
On failure, returns NULL.
β³ SINCE β³
5.1.1
[Unstable API]: The API may need a slight redesign.
okay bye bestie π β source/version: Allegro reference manual Β· page: al_create_audio_recorder(3) Β· date: ngl, this footer doesnβt print one, so Iβm not inventing a date. π
π¦ 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