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), thenum_samplesfields in the ImportClient and the ExportBucket get ignored. and a write past the end of the bucket will result in anAuBadLengtherror. so like, don't do that. that's the vibe check failing fr fr π
π₯ Errors π₯
AuBadFlowAuBadElementAuBadValueAuBadLength
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
- debian bookworm: libaudio-dev 1.9.4-7
- debian trixie: libaudio-dev 1.9.4-9
- ubuntu jammy: libaudio-dev 1.9.4-7build1
- ubuntu noble: libaudio-dev 1.9.4-8
- ubuntu questing: libaudio-dev 1.9.4-9
- ubuntu resolute: libaudio-dev 1.9.4-9.2
- ubuntu stonking: libaudio-dev 1.9.4-9.2
- copyright 1994 Steven King
- Copyright 1993 Network Computing Devices, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms