AuSoundRecordToBucket(3)

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

πŸ’– AuSoundRecordToBucket πŸ’–

ok so bestie, gather round, because today we're talking about AuSoundRecordToBucket from soundlib β€” it's a function that lives in the audio library and it is literally the girlboss of recording-to-a-bucket. She creates a flow. She records. She serves. πŸŽ€

It hangs out in the Library Functions Manual section, and yes, she's a C function, and yes, she's iconic. Let's get into it. πŸ¦‹


✨ SYNOPSIS ✨

First things first, you gotta invite the right headers to the party:

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

and then the main character herself:

AuEventHandlerRec *AuSoundRecordToBucket(server, destination, source,
gain, callback, callback_data, mode, flow, volume_mult_elem, status)
    AuServer *server;
    AuBucketID destination;
    AuDeviceID source;
    AuFixedPoint gain;
    void (*callback) (AuServer *, AuEventHandlerRec *, AuEvent *,
AuPointer);
    AuPointer callback_data;
    int mode;
    AuFlowID *flow; /* RETURN */
    int *volume_mult_elem; /* RETURN */
    AuStatus *status; /* RETURN */

no cap, she takes a lot of arguments. she's high maintenance but she delivers. πŸ’…


🌸 ARGUMENTS 🌸

okay so let's do a vibe check on every single one of these, because we are NOT skipping any:

  • server β€” the connection to the audio server. your lil hotline to the sound gods. 🫢
  • destination β€” the bucket you're recording to. that's the target. the goal. the moment.
  • source β€” the input device you're recording from. your mic, your line-in, whatever's catching the audio. 🎀
  • gain β€” the gain for the input device. turn it up (or down, we don't judge). an AuFixedPoint, so handle with care.
  • callback β€” the procedure to be called for additional event processing. she's the girl you call when more stuff needs handling.
  • callback_data β€” any additional arguments to be passed to that callback. little care package for your callback bestie. 🎁
  • mode β€” the line mode for the input device. currently the following line modes are defined: AuDeviceInputModeNone, AuDeviceInputModeLineIn, AuDeviceInputModeMicrophone. pick your fighter. ✨
  • flow β€” if it's non-NULL, it returns the flow ID. so like, if you want to know the flow ID, hand her a pointer and she'll fill it in. if you don't care, pass NULL and keep it moving.
  • volume_mult_elem β€” okay bestie, according to the comment in the source, not implemented. πŸ’€ that's it. that's the whole lore. don't expect anything from her.
  • status β€” if it's non-NULL, she flushes the output buffer and returns the status from the server. so if you wanna know how it went, give her somewhere to put the tea. 🍡

πŸ‘‘ DESCRIPTION πŸ‘‘

AuSoundRecordToBucket creates a flow to record from source into destination, and returns a pointer to the event handler created β€” or NULL if there was an error. 😭

so basically: you point her at a source, you point her at a destination bucket, she sets up the whole flow, and she hands you back an AuEventHandlerRec *. if she hands you back NULL, something went wrong and we're sad about it. that's the deal. periodt. πŸ’œ


🚨 ERRORS 🚨

if things go sideways, you might catch:

  • AuBadBucket
  • AuBadDevice

ngl, these are the "bestie that's not a real bucket" and "bestie that's not a real device" moments. πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯

more reading if you're obsessed (and you should be):

  • AuSoundRecord
  • AuSoundRecordToData
  • AuSoundRecordToFile
  • AuSoundRecordToFileN
  • audiolib β€” Network Audio System C Language Interface

mwah πŸ’‹ that's the whole page. go record something gorgeous.

this was soundlib version 1.9.5, from AuSoundRecordToBucket(3) β€” thanks for scrolling all the way down, you're the real main character 🫢✨

πŸ“¦ where this page comes from