AuSoundPlay(3)

πŸ’– AuSoundPlay(3) β€” Library Functions Manual πŸ’–

okay bestie, gather round, because we're about to talk about AuSoundPlay from the Library Functions Manual and honestly? she's iconic. no cap.


✨ Name ✨

AuSoundPlay β€” create a flow to play audio from any source. it's giving "audio, but make it a whole flow." πŸŽ€


🌸 Synopsis 🌸

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

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

like look at all those params. she's high maintenance but she delivers πŸ’…


πŸ¦‹ Arguments πŸ¦‹

  • server β€” the connection to the audio server. your lil hotline to the server, basically 🫢
  • destination β€” the device where the audio data gets output. that's where the sound goes, periodt.
  • volume β€” specifies the volume. turn it up, bestie πŸ”Š
  • mode β€” specifies the line mode for the output device. rn the defined line modes are: AuDeviceOutputModeNone, AuDeviceOutputModeSpeaker, AuDeviceOutputModeHeadphone, AuDeviceOutputModeLineOut. pick your vibe 🌈
  • sound_data β€” specifies the sound information. all the deets about your audio live in here.
  • flow β€” if it's non-NULL, returns the flow ID. it's a RETURN param, so she's handing you info back 😭
  • volume_mult_elem β€” if it's non-NULL, returns the index of the volume multipler element. (yes, "multipler" β€” that's literally how it's spelled, i don't make the rules πŸ™ˆ)
  • monitor_element β€” if it's non-NULL, include an ExportMonitor element in the flow and return it's index. so you're not just playing, you're also monitoring πŸ‘‘
  • status β€” if it's non-NULL, flush the output buffer and return the status from the server. very "tell me what happened" energy πŸ’œ

🌟 Description 🌟

so what does she actually do? AuSoundPlay creates a flow to play audio from any source on the device, and it returns a pointer to the event handler that was created β€” or NULL if something went wrong. πŸ’€

and the sound_data structure? she's the main character here, because she holds all the necessary info about the audio format AND the data handling function. everything you need to know about your audio, all in one struct. ate. πŸ”₯


😭 Errors 😭

  • AuBadDevice.

that's it. that's the list. if the device is bad, she will let you know. no notes.


πŸŽ€ See Also πŸŽ€

  • AuSoundPlayFromBucket
  • AuSoundPlayFromData
  • AuSoundPlayFromFile
  • AuSoundPlaySynchronousFromFile

and also, the whole audiolib β€” Network Audio System C Language Interface. go read it, iykyk πŸ’–


k bye bestie, that's the whole page!! this one's from soundlib, version 1.9.4, and it's literally the AuSoundPlay(3) manual page. go play some audio, you've earned it βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from