roar_str2codec(3)

roar_str2codec3

Get codec id by codec name roar_codec2str - get codec name by id

Usage

#include <roaraudio.h>

int roar_str2codec (char * codec);
char * roar_codec2str (int codec);

Overview

roar_str2codec converts a string to a RoarAudio Codec ID. It also supports some common aliases. roar_codec2str is the reverse operation of roar_str2codec: It gets a name by the ID given. If a codec is valid the following should be true:
roar_str2codec(roar_codec2str(codec)) == codec

Note that because of aliasing and case insensitivity the revers operation needs not to be true.

Thread safety

Because roar_codec2str returns a static unique pointer for each codec it is fully thread safe.

Return value

On success roar_str2codec returns a codec ID. On error, -1 is returned. roar_codec2str returns the name of the codec or NULL on error. You must not free this pointer or write to it.

Examples

FIXME

Releases

6 releases since Debian 6.0 (Squeeze); the text changed 2 times.

  1. 6.0
  2. 7–9
  3. 10–11

From libroar-dev 1.0~beta12-4 in Debian 11 (Bullseye). Parsed by carta from the page's man source.