AuSoundPlayFromFile(3)
π AuSoundPlayFromFile β bestie's guide to yeeting a whole file at your speakers π
okay so this one lives in the soundlib corner of the Network Audio System universe, and it's literally the "play me a file, queen" function. No cap.
β¨ NAME β¨
AuSoundPlayFromFile β create a flow to play a file. π That's it. That's the whole job. She builds you a flow, she plays your file, she slays.
πΈ SYNOPSIS πΈ
#include <audio/audiolib.h>
#include <audio/soundlib.h>
AuEventHandlerRec *AuSoundPlayFromFile(server, filename, destination,
volume, callback, callback_data, flow ,volume_mult_elem,
monitor_element, status)
AuServer *server;
char *filename;
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 */
look at all those /* RETURN */ comments β those are the out-params, the little gifts she hands back to you. π«Ά
π¦ ARGUMENTS π¦
serverβ the connection to the audio server. your whole entire link to the audio world, fr.filenameβ the name of the file you want played. the star of the show. πdestinationβ the device the audio data gets output to. where the sound actually goes.volumeβ the volume. yes bestie, you get to set it.callbackβ the procedure that gets called when there's extra event processing to do. like, "hey, something else happened, handle it."callback_dataβ any extra arguments you wanna pass along to thatcallback. your little care package. πflowβ if it's non-NULL, she returns the flow ID in it.volume_mult_elemβ if it's non-NULL, she returns the index of the volume multipler element. (yep, that's the spelling, we don't make the rules π )monitor_elementβ if it's non-NULL, anExportMonitorelement gets included in the flow and its index comes back to you.statusβ if it's non-NULL, the output buffer gets flushed and the status from the server gets returned. flush it, periodt.
π DESCRIPTION π
AuSoundPlayFromFile creates a flow to play filename on device, and hands you back a pointer to the event handler it created β or NULL if something went wrong. π
that's the vibe. pointer = we're good. NULL = we are not good, bestie, check your setup.
π ERRORS π
AuBadDevice.
that's the one. that's the whole list. if you see it, the device was bad and the function is telling you so. π
π₯ SEE ALSO π₯
AuSoundPlayAuSoundPlayFromBucketAuSoundPlayFromDataAuSoundPlaySynchronousFromFileaudiolibβ Network Audio System C Language Interface
and that's the page, bestie!! β¨ this one comes from soundlib, version 1.9.4, and the whole thing is filed under AuSoundPlayFromFile(3) in section 3, Library Functions Manual. go play your little file. πππ¦
π¦ 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