AuDeviceAttributes(3)

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

πŸ’– AuDeviceAttributes β€” device attributes structure πŸ’–

okay bestie, welcome to the AuDeviceAttributes page from the Library Functions Manual β€” yes, that's the same crew that brings you audiolib, the Network Audio System C Language Interface. sit down, grab a strawberry πŸ“, and let's get into it.


✨ Structures ✨

first things first, the header. you gotta pull it in:

#include <audio/audiolib.h>

and here's the struct itself, iconic, mysterious, full of . . .:

typedef struct _AuDeviceAttributes
{
    . . .
}AuDeviceAttributes;

πŸŽ€ Members πŸŽ€

🚨 NO CAP, IMPORTANT: do not dereference the members of the AuDeviceAttributes structure directly. that's not the vibe. use the access macros instead, bestie. periodt.

so, throughout all of this: da is a pointer to a AuDeviceAttributes structure. keep that in your notes πŸ“

  • AuDeviceValueMask(da) β€” gets you the AuMask value that says which attributes are actually present. it's a bitwise inclusive OR of these constants: AuCompCommonIDMask, AuCompCommonKindMask, AuCompCommonUseMask, AuCompCommonFormatMask, AuCompCommonNumTracksMask, AuCompCommonAccessMask, AuCompCommonDescriptionMask, AuCompDeviceMinSampleRateMask, AuCompDeviceMaxSampleRateMask, AuCompDeviceLocationMask, AuCompDeviceGainMask, AuCompDeviceLineModeMask, and AuCompDeviceChildrenMask. that's a lot of masks, but we ate πŸ’…
  • AuDeviceChangableMask(da) β€” gets you the AuMask value that says which attributes can be changed. also a bitwise inclusive OR of these constants: AuCompCommonIDMask, AuCompCommonKindMask, AuCompCommonUseMask, AuCompCommonFormatMask, AuCompCommonNumTracksMask, AuCompCommonAccessMask, AuCompCommonDescriptionMask, AuCompDeviceMinSampleRateMask, AuCompDeviceMaxSampleRateMask, AuCompDeviceLocationMask, AuCompDeviceGainMask, AuCompDeviceLineModeMask, and AuCompDeviceChildrenMask. yes, same list as above, and yes, that's on purpose 🫢
  • AuDeviceIdentifier(da) β€” gets you the AuFlowID ID of the device. its little name tag 🏷️
  • AuDeviceKind(da) β€” gets you the int value saying what kind of component this is. devices are either AuComponentKindPhysicalInput or AuComponentKindPhysicalOutput. pick your fighter.
  • AuDeviceUse(da) β€” gets you the AuMask value saying which uses of the device are permitted. bitwise inclusive OR of: AuComponentUseImportMask and AuComponentUseExportMask.
  • AuDeviceFormat(da) β€” gets you the int value saying the audio data format the device uses. rn the defined formats are: AuFormatULAW8, AuFormatLinearUnsigned8, AuFormatLinearSigned8, AuFormatLinearSigned16MSB, AuFormatLinearUnsigned16MSB, AuFormatLinearSigned16LSB, and AuFormatLinearUnsigned16LSB. seven formats, all valid, all slaying ✨
  • AuDeviceNumTracks(da) β€” gets you the int value saying how many tracks the device supports. multitrack queen πŸ‘‘
  • AuDeviceAccess(da) β€” gets you the AuMask value saying which kinds of access are allowed. bitwise inclusive OR of: AuAccessImportMask, AuAccessExportMask, AuAccessDestroyMask, and AuAccessListMask.
  • AuDeviceDescription(da) β€” gets you the AuString structure holding a textual description of the device. the bio, basically πŸ“–
  • AuDeviceMinSampleRate(da) β€” gets you the unsigned int value saying the minimum sample rate the device supports.
  • AuDeviceMaxSampleRate(da) β€” gets you the unsigned int value saying the maximum sample rate the device supports. min and max, a matched set πŸŽ€
  • AuDeviceLocation(da) β€” gets you the AuMask value saying where the device is located. bitwise inclusive OR of: AuDeviceLocationLeftMask, AuDeviceLocationCenterMask, AuDeviceLocationRightMask, AuDeviceLocationTopMask, AuDeviceLocationMiddleMask, AuDeviceLocationBottomMask, AuDeviceLocationBackMask, AuDeviceLocationFrontMask, AuDeviceLocationInternalMask, and AuDeviceLocationExternalMask. (heads up: no period after that last one in the source, we're keeping it exactly as-is, character for character, iykyk)
  • AuDeviceGain(da) β€” gets you the AuFixedPoint value with the current hardware amplification level. turn it up πŸ”Š
  • AuDeviceLineMode(da) β€” gets you the AuInt32 value saying the current line mode. input device only, so don't come for it if you're on output, bestie πŸ™ˆ
  • AuDeviceNumChildren(da) β€” gets you the int value saying how many subcomponents the device has. it's giving family tree 🌳
  • AuDeviceChildren(da) β€” gets you the list of AuDeviceID's of the subcomponents of the device. the whole friend group 🌈

🌸 Description 🌸

okay so the AuDeviceAttributes structure describes the physical hardware interface. that's it, that's the whole job, and honestly? it does it beautifully. main character energy fr fr πŸ’œ


πŸ¦‹ See Also πŸ¦‹

  • AuGetDeviceAttributes
  • AuListDevices
  • audiolib β€” Network Audio System C Language Interface

and that's the page, bestie!! this one's from audiolib 1.9.5, and yeah, the footer really does say "audiolib - device attributes stru... 1.9.5" because even the manpage footer got truncated mid-sentence and honestly, relatable 😭 anyway, AuDeviceAttributes(3), Library Functions Manual, that's a wrap. go use your access macros. not the struct directly. never the struct directly. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from