AuSoundPlayFromData(3)

πŸ’– AuSoundPlayFromData β€” bestie edition πŸ’–

okay so this is a page from the Library Functions Manual, and it lives in section 3 of the manual, under the name AuSoundPlayFromData. it's giving "let's make some noise, but from RAM" energy and honestly? iconic.


✨ NAME ✨

AuSoundPlayFromData β€” create a flow to play from memory. that's it, that's the whole vibe. no file, no bucket, just data sitting in memory waiting to be heard. πŸŽ€


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

like. look at all those parameters. she's thorough. she's doing the most and we love that for her. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • server β€” the connection to the audio server. your little phone line to the sound gods. ✨
  • sound β€” the description of the audio data. the ~metadata moment~.
  • data β€” the actual audio data you wanna play. the main character, literally.
  • destination β€” the device to play the data on. where the sound goes to live its life. πŸ”Š
  • volume β€” the volume. you know what this is bestie, turn it up. πŸ”₯
  • callback β€” the procedure to be called for additional event processing. she calls you back, she's not ghosting. πŸ’œ
  • callback_data β€” any additional arguments to be passed the callback. lil gift bag for the callback. 🎁
  • flow β€” if non-NULL, returns the flow ID. a RETURN value, no cap.
  • volume_mult_elem β€” if non-NULL, returns the index of the volume multipler element. yes it says "multipler", we're not fixing it, we're respecting the source. also it's a RETURN. 🫢
  • monitor_element β€” if non-NULL, include an ExportMonitor element in the flow and return it's index. (again, "it's" not "its", we keep it exactly as written, we don't edit the ancestors.) RETURN energy.
  • status β€” if non-NULL, flush the output buffer and return the status from the server. RETURN. 🌈

πŸ‘‘ DESCRIPTION πŸ‘‘

AuSoundPlayFromData creates a flow to play data on device and returns a pointer to the event handler created, or NULL if there was an error. simple. clean. no notes. periodt. πŸ’…βœ¨


πŸ’€ ERRORS πŸ’€

  • AuBadAlloc
  • AuBadDevice

yeah so if you see one of these, something said no. respect the no. 😭


🌟 SEE ALSO 🌟

  • AuSoundPlay
  • AuSoundPlayFromBucket
  • AuSoundPlayFromFile
  • AuSoundPlaySynchronousFromFile

and also, of course:

  • audiolib β€” Network Audio System C Language Interface

lowkey reminder: this whole thing is soundlib 1.9.4 and it's the AuSoundPlayFromData(3) page from the Library Functions Manual β€” go read your other manpages bestie, they're all part of the same friend group 🫢🌸

that's the page. slay, compile responsibly, and remember: memory is the best bucket because it's already in your hands. πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from