AuSoundPlayFromData(3)

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

πŸ’– AuSoundPlayFromData(3) β€” the soundlib bestie that plays straight from memory πŸ’–

okay so bestie, this one lives in soundlib, which is part of the whole Network Audio System audiolib situation. And it does EXACTLY what the name says: it builds you a whole flow so you can play audio that's just… chilling in memory. No file. No bucket. Just a pointer and vibes. πŸ’…βœ¨


🌸 NAME 🌸

AuSoundPlayFromData β€” create a flow to play from memory.

πŸŽ€ SYNOPSIS πŸŽ€

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

AuEventHandlerRec *AuSoundPlayFromData(server, sound, data, destination,
volume, callback, callback_data, flow, volume_mult_elem,
monitor_element, status)
    AuServer *server;
    Sound sound;
    AuPointer data;
    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 */

πŸ’œ ARGUMENTS πŸ’œ

  • server β€” the connection to the audio server. your link to the mothership, fr.
  • sound β€” the description of the audio data. the lil' metadata moment.
  • data β€” the actual audio data you wanna play. the goods. πŸ“
  • destination β€” the device you're playing this data on. where it's gonna come out of.
  • volume β€” the volume. yes queen, set the level.
  • callback β€” the procedure to be called for extra event processing. your little side quest handler.
  • callback_data β€” any extra arguments you want passed to that callback. tuck them in there.
  • 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.
  • monitor_element β€” if it's non-NULL, it includes an ExportMonitor element in the flow and returns its index. πŸ‘€ watching it.
  • status β€” if it's non-NULL, it flushes the output buffer and returns the status from the server. the receipts.

✨ DESCRIPTION ✨

So like, AuSoundPlayFromData creates a flow to play data on device and hands you back a pointer to the event handler it made. 🫢

And if things go sideways? It returns NULL. that's the error signal, no cap. 😭

ngl, NULL means something went wrong β€” don't just keep going and pretend you didn't see it.

πŸ’€ ERRORS πŸ’€

It can hit you with:

  • AuBadAlloc
  • AuBadDevice

πŸ”₯ SEE ALSO πŸ”₯

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

mwah πŸ’‹ that's the whole page, bestie. this one's from the soundlib source, version 1.9.5, and yeah β€” it's AuSoundPlayFromData(3). go play some memory-resident audio, you icon. πŸ‘‘πŸŒΈβœ¨

πŸ“¦ where this page comes from