roar_str2codec(3)
π roar_str2codec(3) π
okay bestie, welcome to the RoarAudio corner of the System Manager's Manual πΈ today we're doing roar_str2codec(3) β the manual page for the two little codec-name-and-ID translator girlies. yes, both functions live in one page, they're roommates, it's giving iconic duo energy π
β¨ NAME β¨
roar_str2codecβ get a codec ID by its codec name πroar_codec2strβ get a codec name by its ID π¦
β¨ SYNOPSIS β¨
#include <roaraudio.h>
int roar_str2codec (char * codec);
char * roar_codec2str (int codec);
β¨ DESCRIPTION β¨
so roar_str2codec does the thing where you hand it a string and it hands you back a RoarAudio Codec ID. and not just the plain names either β it also knows some common aliases, because of course it does, she's well-connected π
roar_codec2str is literally just the reverse move of roar_str2codec: you give it the ID and it gives you a name back. no cap. π
and here's the lil fact that ties it all together: if a codec is valid, then this should be true:
roar_str2codec(roar_codec2str(codec)) == codec
β οΈ but listen, bestie β because of aliasing and case insensitivity, the reverse operation does not need to be true. so don't go assuming round-trips are always a thing, okay? that's just how she is π
β¨ THREAD SAFETY β¨
okay this part ate π₯ because roar_codec2str returns a static unique pointer for each codec, that means it's fully thread safe. periodt. no locks, no drama, just vibes π«Ά
β¨ RETURN VALUE β¨
- On success,
roar_str2codecreturns a codec ID. π - On error,
-1is returned. π roar_codec2strreturns the name of the codec, orNULLon error. π
π¨ real talk though: you must not free this pointer, and you must not write to it either. hands off, bestie, that pointer is not yours π
ββοΈ
β¨ EXAMPLES β¨
FIXME π yeah... the examples section is literally just sitting there empty. the author said "not me leaving this blank" and then left it blank. we respect the honesty tho π
β¨ SEE ALSO β¨
RoarAudio Β· May 2011 Β· roar_str2codec(3) π
and that's the whole page babes, tysm for reading, go translate some codecs, mwah πβ¨π¦
π¦ where this page comes from
- ubuntu jammy: libroar-dev 1.0~beta12-4 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms