AuConvertShortToData(3)

πŸ’– AuConvertShortToData(3) πŸ’–

okay so bestie, welcome to the Library Functions Manual β€” this is the AuConvertShortToData page and it's lowkey a lil legend. it lives in audio/audiolib.h, it's giving audio-girlie energy, and it does exactly one thing but it does it flawlessly. let's get into it πŸŽ€


✨ NAME ✨

AuConvertShortToData β€” converts signed short integers to the specified format. that's it. that's the whole job. no cap. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <audio/audiolib.h>

int AuConvertShortToData(format, num_bytes, data)
    int format;
    int num_bytes;
    AuPointer data;

she's a classic. takes three args, returns an int, doesn't overcomplicate. main character energy fr πŸ’…


🧚 ARGUMENTS 🧚

  • format β€” the format you wanna convert to. currently, the following data formats are defined: AuFormatULAW8, AuFormatLinearUnsigned8, AuFormatLinearSigned8, AuFormatLinearSigned16MSB, AuFormatLinearUnsigned16MSB, AuFormatSignedLinear16LSB, and AuFormatLinearUnsigned16LSB. yes bestie, that's the whole list, and you gotta pick from it πŸ‘‘
  • num_bytes β€” the number of bytes of data. literally just how much data we're working with, count them bytes, don't skip any πŸ“
  • data β€” the data to convert. hand it over, she'll handle it 🫢

πŸ’« DESCRIPTION πŸ’«

okay so here's the tea: AuConvertShortToData converts num_bytes of data from signed short integer to format. that's the vibe. she's a converter, she's focused, she's not doing side quests.

and the return value? iconic and simple:

  • returns 0 if successful πŸŽ‰
  • returns -1 if format isn't valid πŸ’€

that's right, if you hand her a bogus format she's not gonna pretend, she's just gonna say -1 and move on. respect. periodt.

ngl, always check that return value β€” a sneaky -1 means your format was a no-go, and your data did not get converted the way you hoped 😭

πŸ”₯ SEE ALSO πŸ”₯

  • AuConvertDataToShort β€” the reverse queen, she does the opposite thing πŸ‘‘
  • audiolib β€” Network Audio System C Language Interface. the whole squad, the whole ecosystem, the whole vibe 🌈

and that's the page!! slay ✨ this lil manual comes to you courtesy of audioutil, version 1.9.4 β€” go forth, convert your shorts, and stay hydrated bestie πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from