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 that callback. 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, an ExportMonitor element 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 πŸ”₯

  • AuSoundPlay
  • AuSoundPlayFromBucket
  • AuSoundPlayFromData
  • AuSoundPlaySynchronousFromFile
  • audiolib β€” 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