AL_CREATE_AUDIO_RECORDER(3)

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

πŸ’– 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 speech
  • 11025
  • 22050
  • 44100 β€” 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