AuSoundPlay(3)

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

πŸ‘‘ NAME πŸ‘‘

AuSoundPlay β€” the girlboss function that creates a flow to play audio from any source. no cap, literally any source. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so first you gotta invite the headers to the party:

#include <audio/audiolib.h>
#include <audio/soundlib.h>

and then the actual function, bestie:

AuEventHandlerRec *AuSoundPlay(server, destination, volume, mode,
sound_data, flow ,volume_mult_elem, monitor_element, status)
    AuServer *server;
    AuDeviceID destination;
    AuFixedPoint volume;
    int mode;
    AuSoundDataPtr sound_data;
    AuFlowID *flow; /* RETURN */
    int *volume_mult_elem; /* RETURN */
    int *monitor_element; /* RETURN */
    AuStatus *status; /* RETURN */

🌸 ARGUMENTS 🌸

here's the rundown, one by one, no skipping, we do not skip in this house:

  • server β€” the connection to the audio server. your lil phone line to the server, basically. 🫢
  • destination β€” the device where the audio data gets output. where the sound is gonna live, bestie.
  • volume β€” the volume. iconic concept. 🌈
  • mode β€” the line mode for the output device. right now the defined line modes are: AuDeviceOutputModeNone, AuDeviceOutputModeSpeaker, AuDeviceOutputModeHeadphone, AuDeviceOutputModeLineOut. pick your vibe, it's giving options. ✨
  • sound_data β€” the sound information. all the deets about your audio.
  • flow β€” if it's non-NULL, it returns the flow ID. πŸ‘‘
  • volume_mult_elem β€” if it's non-NULL, it returns the index of the volume multipler element. (yes, "multipler", that's how the original spells it, i'm not gonna gaslight the manpage. πŸ’€)
  • monitor_element β€” if it's non-NULL, it includes an ExportMonitor element in the flow and returns its index.
  • status β€” if it's non-NULL, it flushes the output buffer and returns the status from the server. flushing, but make it ✨functional✨.

πŸ’– DESCRIPTION πŸ’–

AuSoundPlay creates a flow to play audio from any source on device, and it returns a pointer to the event handler that got created β€” or NULL if there was an error. 😭

the sound_data structure is where all the important stuff lives: it holds the necessary information about the audio format and the data handling function. so like, the format AND the whole personality of your audio. that's the structure's job. πŸŽ€


πŸ’€ ERRORS πŸ’€

  • AuBadDevice.
that's it. that's the list. one single error and it ate. don't fight it. πŸ“

⭐ SEE ALSO ⭐

go read these next, they're the whole friend group:

  • AuSoundPlayFromBucket
  • AuSoundPlayFromData
  • AuSoundPlayFromFile
  • AuSoundPlaySynchronousFromFile

and also:

  • audiolib β€” Network Audio System C Language Interface. the mothership. πŸ’œ

okay bestie that's the whole page, you're officially fluent in AuSoundPlay and i'm so proud of you, go make a flow and slay. mwah. πŸ’…βœ¨

this was soundlib, version 1.9.5, serving you the AuSoundPlay(3) manual page. periodt. 🫢

πŸ“¦ where this page comes from