AuSoundPlayFromFile(3)

πŸ“¦ version 1.9.5, in fedora 43, fedora 44

✨ AuSoundPlayFromFile β€” like, the manual page πŸ’–

okay bestie, so this is AuSoundPlayFromFile(3) from the Library Functions Manual. it lives in soundlib (Network Audio System C Language Interface, iykyk) and it is literally the "play me a whole file" button. let's go πŸŽ€


🌸 NAME 🌸

AuSoundPlayFromFile β€” create a flow to play a file. that's it, that's the whole vibe. πŸ¦‹


✨ 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 */

like, that's a lot of arguments babe, but every single one of them is doing her job and we respect her for it πŸ’…


🫢 ARGUMENTS 🫢

  • server β€” the connection to the audio server. your lil phone line to the sound gods, basically ☎️
  • filename β€” the name of the file you wanna play. yes the actual name, don't be cute with it 🎡
  • destination β€” the device that the audio data gets output to. where the noise comes out πŸ‘‘
  • volume β€” the volume. loudness level, no notes ✨
  • callback β€” the procedure that gets called for additional event processing. she gets a lil ping when there's more to handle πŸ’–
  • callback_data β€” any additional arguments to be passed to the callback. lil care package for your callback 🎁
  • flow β€” if non-NULL, returns the flow ID. if you're NULL, she stays quiet, periodt.
  • volume_mult_elem β€” if non-NULL, returns the index of the volume multipler element. (yes, "multipler", that's how it's spelled in the source, we don't fix other people's typos, we honor them πŸ™ˆ)
  • monitor_element β€” if non-NULL, include an ExportMonitor element in the flow and return its index. two jobs, one argument, she's booked and busy πŸ”₯
  • status β€” if non-NULL, flush the output buffer and return the status from the server. get that receipt bestie 🧾

πŸ’œ DESCRIPTION πŸ’œ

AuSoundPlayFromFile creates a flow to play filename on destination and returns a pointer to the event handler created, or NULL if there was an error.

that's the whole plot. flow created, file played, handler pointer returned. and if something went sideways? NULL. not me getting a NULL and having to check it 😭 β€” always check it, bestie, fr fr.


πŸ’€ ERRORS πŸ’€

  • AuBadDevice.
that's the one and only error listed here. if your device is bad, she will simply tell you. no cap.

🌈 SEE ALSO 🌈

  • AuSoundPlay
  • AuSoundPlayFromBucket
  • AuSoundPlayFromData
  • AuSoundPlaySynchronousFromFile
  • audiolib β€” Network Audio System C Language Interface

go read those too, they're the rest of the girlies in this friend group πŸ¦‹βœ¨


and that's the page!! this came out of soundlib, version 1.9.5 β€” the copyright/version line at the bottom of the original, which we are lovingly shouting out right here at the end instead. mwah πŸ’…πŸ’–πŸŒΈ

πŸ“¦ where this page comes from