AuWriteElement(3)

πŸ’– AuWriteElement β€” Library Functions Manual energy πŸ’–

okay bestie, sit down, hydrate, and let me tell you about the most main-character function in <audio/audiolib.h>: AuWriteElement. she writes data to an ImportClient element in a flow. that's it. that's the girl. πŸŽ€


✨ Name ✨

AuWriteElement β€” write data to an ImportClient element in a flow πŸ¦‹


🌸 Synopsis 🌸

#include <audio/audiolib.h>

void AuWriteElement(server, flow, element, num_bytes, data, end_of_data,
status)
    AuServer *server;
    AuFlowID flow;
    int element;
    AuUint32 num_bytes;
    AuPointer data;
    AuBool end_of_data;
    AuStatus *status; /* RETURN */

no cap, that's the whole signature, copy it exactly, don't be cute with it πŸ’…


🫢 Arguments 🫢

  • server β€” the connection to the audio server. your lil hotline to the server, basically. ☎️
  • flow β€” the ID of the flow. yes, the whole flow. her ID, please and thank you.
  • element β€” the index of the ImportClient element you're writing the data to. index, not the ID, don't mix them up bestie 😭
  • num_bytes β€” how many bytes of audio data you're writing. AuUint32. count them.
  • data β€” the buffer you're pulling the audio data from. AuPointer. it's giving source material.
  • end_of_data β€” tells everyone whether this is the last write for this import. AuBool. is this the finale or not πŸ’€
  • status β€” if it's non-NULL, the output buffer gets flushed and the status from the server gets returned. she's the /* RETURN */ one, the little reporter πŸ‘‘

πŸ’œ Description πŸ’œ

AuWriteElement transfers audio data from the client application over to the server. specifically, it writes num_bytes from data into the ImportClient that's specified by element, inside the audio flow flow. ✨

and if end_of_data is AuTrue, the ImportClient's eof flag gets set once the write is completed. so like, she knows it's over. periodt. πŸŽ€


πŸ™ˆ Note πŸ™ˆ

if the flow is "trivial" (meaning it's only an ImportClient and an ExportBucket), the num_samples fields in the ImportClient and the ExportBucket get ignored. and a write past the end of the bucket will result in an AuBadLength error. so like, don't do that. that's the vibe check failing fr fr πŸ’€

πŸ”₯ Errors πŸ”₯

  • AuBadFlow
  • AuBadElement
  • AuBadValue
  • AuBadLength

yes, all four. collect them like Pokémon if you're being chaotic, but ideally you collect zero 🧚


⭐ See Also ⭐

  • AuReadElement β€” her sister, the reader. the way that they're a matched set πŸ¦‹
  • audiolib β€” Network Audio System C Language Interface. the whole cinematic universe, iykyk πŸ‘‘

and that's the page bestie!! 🌈 this was AuWriteElement(3) from the Library Functions Manual, part of audiolib, version 1.9.4, footer-coded as audiolib - write to element πŸ’– slay, go write some audio data, and remember: end_of_data = AuTrue means it's the last one, so make it iconic πŸ’…βœ¨

πŸ“¦ where this page comes from