AuSoundPlayFromBucket(3)

✨ AuSoundPlayFromBucket(3) ✨

okay bestie, so this one lives in the Library Functions Manual and it's called AuSoundPlayFromBucket(3) β€” and no cap, it's giving "make the bucket go brrr on the device". let's get into it πŸ’–


🌸 NAME 🌸

AuSoundPlayFromBucket β€” create a flow to play from a bucket. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

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

AuEventHandlerRec *AuSoundPlayFromBucket(server, source, destination,
volume, callback, callback_data, loop_count, flow, volume_mult_elem,
monitor_element, status)
    AuServer *server;
    AuBucketID source;
    AuDeviceID destination;
    AuFixedPoint volume;
    void (*callback) (AuServer *, AuEventHandlerRec *, AuEvent *,
AuPointer);
    AuPointer callback_data;
    int loop_count;
    AuFlowID *flow; /* RETURN */
    int *volume_mult_elem; /* RETURN */
    int *monitor_element; /* RETURN */
    AuStatus *status; /* RETURN */

look at all those params. it's a lot. she's high maintenance but she's worth it πŸ’…


πŸ’œ ARGUMENTS πŸ’œ

  • server β€” the connection to the audio server. your lil hotline to the audio gods fr.
  • source β€” the bucket to play. the actual bop material πŸ“
  • destination β€” the device to output the audio data. where the sound gets to live its main character moment.
  • volume β€” the volume. self-explanatory bestie, turn it up.
  • callback β€” the procedure to be called for additional event processing. your girl for the extra events, iykyk.
  • callback_data β€” any additional arguments to be passed to the callback. lil goodie bag for the callback 🎁
  • loop_count β€” how many time the bucket should be played. (yes it says "time", singular, we're not fixing it, we're just noting it 🫢) so like... how many loops. on repeat. periodt.
  • flow β€” if non-NULL, returns the flow ID. otherwise it just minds its business.
  • volume_mult_elem β€” if non-NULL, returns the index of the volume multipler element. (that's "multipler" exactly as written, iconic typo, we stan ✨)
  • monitor_element β€” if non-NULL, include an ExportMonitor element in the flow and return it's index. yes, it's gets ExportMonitor treatment now πŸ’…
  • status β€” if non-NULL, flush the output buffer and return the status from the server. the receipts, basically 🧾

🌈 DESCRIPTION 🌈

AuSoundPlayFromBucket creates a flow to play bucket on device and returns a pointer to the event handler created, or NULL if there was an error. 😭

that's the whole plot. flow gets made, bucket gets played on device, you get a pointer back β€” or you get NULL and a bad day. keep an eye on that return value bestie, fr fr.


πŸ’€ ERRORS πŸ’€

  • AuBadBucket
  • AuBadDevice

two ways to fumble. not me getting an AuBadBucket... πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

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

the whole friend group honestly 🫢 go read them too.


okay that's the page!! this one is from soundlib, version 1.9.4, and it's AuSoundPlayFromBucket(3) β€” go play some buckets, you ate πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from