AuSoundPlayFromData(3)
π AuSoundPlayFromData β bestie edition π
okay so this is a page from the Library Functions Manual, and it lives in section 3 of the manual, under the name AuSoundPlayFromData. it's giving "let's make some noise, but from RAM" energy and honestly? iconic.
β¨ NAME β¨
AuSoundPlayFromData β create a flow to play from memory. that's it, that's the whole vibe. no file, no bucket, just data sitting in memory waiting to be heard. π
πΈ SYNOPSIS πΈ
#include <audio/audiolib.h>
#include <audio/soundlib.h>
AuEventHandlerRec *AuSoundPlayFromData(server, sound, data, destination,
volume, callback, callback_data, flow, volume_mult_elem,
monitor_element, status)
AuServer *server;
Sound sound;
AuPointer data;
AuDeviceID destination;
AuFixedPoint volume;
void (*callback) (AuServer *, AuEventHandlerRec *, AuEvent *,
AuPointer);
AuPointer callback_data;
AuFlowID *flow; /* RETURN */
int *volume_mult_elem; /* RETURN */
int *monitor_element; /* RETURN */
AuStatus *status; /* RETURN */
like. look at all those parameters. she's thorough. she's doing the most and we love that for her. π
π¦ ARGUMENTS π¦
serverβ the connection to the audio server. your little phone line to the sound gods. β¨soundβ the description of the audio data. the ~metadata moment~.dataβ the actual audio data you wanna play. the main character, literally.destinationβ the device to play the data on. where the sound goes to live its life. πvolumeβ the volume. you know what this is bestie, turn it up. π₯callbackβ the procedure to be called for additional event processing. she calls you back, she's not ghosting. πcallback_dataβ any additional arguments to be passed the callback. lil gift bag for the callback. πflowβ if non-NULL, returns the flow ID. a RETURN value, no cap.volume_mult_elemβ if non-NULL, returns the index of the volume multipler element. yes it says "multipler", we're not fixing it, we're respecting the source. also it's a RETURN. π«Άmonitor_elementβ if non-NULL, include anExportMonitorelement in the flow and return it's index. (again, "it's" not "its", we keep it exactly as written, we don't edit the ancestors.) RETURN energy.statusβ if non-NULL, flush the output buffer and return the status from the server. RETURN. π
π DESCRIPTION π
AuSoundPlayFromData creates a flow to play data on device and returns a pointer to the event handler created, or NULL if there was an error. simple. clean. no notes. periodt. π
β¨
π ERRORS π
AuBadAllocAuBadDevice
yeah so if you see one of these, something said no. respect the no. π
π SEE ALSO π
AuSoundPlayAuSoundPlayFromBucketAuSoundPlayFromFileAuSoundPlaySynchronousFromFile
and also, of course:
audiolibβ Network Audio System C Language Interface
lowkey reminder: this whole thing issoundlib1.9.4 and it's theAuSoundPlayFromData(3)page from the Library Functions Manual β go read your other manpages bestie, they're all part of the same friend group π«ΆπΈ
that's the page. slay, compile responsibly, and remember: memory is the best bucket because it's already in your hands. πππ¦
π¦ where this page comes from
- debian bookworm: libaudio-dev 1.9.4-7
- debian trixie: libaudio-dev 1.9.4-9
- ubuntu jammy: libaudio-dev 1.9.4-7build1
- ubuntu noble: libaudio-dev 1.9.4-8
- ubuntu questing: libaudio-dev 1.9.4-9
- ubuntu resolute: libaudio-dev 1.9.4-9.2
- ubuntu stonking: libaudio-dev 1.9.4-9.2
- copyright 1994 Steven King
- Copyright 1993 Network Computing Devices, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms