AuSoundRecordToFile(3)

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

πŸ’– AuSoundRecordToFile(3) πŸ’–

okay bestie, welcome to the Library Functions Manual section, we're talking AuSoundRecordToFile today and honestly? she's a baddie. πŸ’…


✨ Name ✨

AuSoundRecordToFile β€” create a flow to record to a file. that's it, that's the whole vibe, she makes flows and she writes files. πŸŽ€


🌸 Synopsis 🌸

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

AuEventHandlerRec *AuSoundRecordToFile(server, filename, source, gain,
callback, callback_data, mode, file_format, comment, rate, data_format,
flow, volume_mult_elem, status)
    AuServer *server;
    char *filename;
    AuDeviceID source;
    AuFixedPoint gain;
    void (*callback) (AuServer *, AuEventHandlerRec *, AuEvent *,
AuPointer);
    AuPointer callback_data;
    int mode;
    int file_format;
    char *comment;
    AuUint32 rate;
    int data_format;
    AuFlowID *flow; /* RETURN */
    int *volume_mult_elem; /* RETURN */
    AuStatus *status; /* RETURN */

look at that signature. thirteen arguments. she's high maintenance but she's worth it. 🫢


πŸ¦‹ Arguments πŸ¦‹

  • server β€” the connection to the audio server. your whole link to the audio world, no server no party. 🌈
  • filename β€” the name of the file you're recording into. yes, literally just the filename. iconic behavior.
  • source β€” which input device to use. pick your fave.
  • gain β€” the gain for the input device. turn it up, turn it down, you do you.
  • callback β€” the procedure that gets called for any extra event processing. your little helper on standby.
  • callback_data β€” any extra arguments you want passed along to that callback. snack for the helper. πŸ“
  • mode β€” the line mode for the input device. currently these line modes are defined: AuDeviceInputModeNone, AuDeviceInputModeLineIn, AuDeviceInputModeMicrophone. microphone mode is giving main character energy fr. 🎀
  • file_format β€” the file format. currently supported: SoundFileFormatSnd, SoundFileFormatVoc, SoundFileFormatWave, SoundFileFormatAiff, SoundFileFormatSvx. five formats, all valid, all slaying. ✨
  • comment β€” a comment to be embedded in the file. like a little note in a locker, but for audio metadata. πŸ’Œ
  • rate β€” the sample rate to record at. numbers, we love her.
  • data_format β€” the data format. currently these are defined: AuFormatULAW8, AuFormatLinearUnsigned8, AuFormatLinearSigned8, AuFormatLinearSigned16MSB, AuFormatLinearUnsigned16MSB, AuFormatSignedLinear16LSB, and AuFormatLinearUnsigned16LSB. seven of them, count 'em. πŸ‘‘
  • flow β€” if it's non-NULL, it returns the flow ID. (RETURN btw)
  • volume_mult_elem β€” according to the comment in the source, this is not implemented. not me getting a parameter that literally does nothing 😭 ngl that's kind of a mood though. (RETURN)
  • status β€” if it's non-NULL, it flushes the output buffer and returns the status from the server. (RETURN)

πŸ’œ Description πŸ’œ

AuSoundRecordToFile creates a flow to record from source to filename, and it returns a pointer to the event handler it created. if something went wrong? you get NULL. no cap.


πŸ’€ Errors πŸ’€

  • AuBadDevice.

that's the one. the whole list. she's concise. πŸ™ˆ


πŸ”₯ See Also πŸ”₯

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

lowkey the whole friend group is here. go read them too, bestie. 🧚

and that's the page!! this came from soundlib, version 1.9.5, dated AuSoundRecordToFile(3) β€” so yeah, you're getting the classic. stay slay, go record some audio, and remember: flush your buffers. πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from