Home
AV module

AudioCodec

Audio codec parameters including channels, sample rate, and sample format.

AudioCodec

#include <icy/av/codec.h>
struct AudioCodec

Defined in src/av/include/icy/av/codec.h:102

Inherits: Codec

Audio codec parameters including channels, sample rate, and sample format.

List of all members

NameKindOwner
channelsvariableDeclared here
sampleFmtvariableDeclared here
AudioCodecfunctionDeclared here
AudioCodecfunctionDeclared here
AudioCodecfunctionDeclared here
AudioCodecfunctionDeclared here
~AudioCodecfunctionDeclared here
toStringfunctionDeclared here
printfunctionDeclared here
namevariableInherited from Codec
encodervariableInherited from Codec
sampleRatevariableInherited from Codec
bitRatevariableInherited from Codec
qualityvariableInherited from Codec
compliancevariableInherited from Codec
enabledvariableInherited from Codec
optionsvariableInherited from Codec
CodecfunctionInherited from Codec
CodecfunctionInherited from Codec
CodecfunctionInherited from Codec
~CodecfunctionInherited from Codec
toStringfunctionInherited from Codec
specifiedfunctionInherited from Codec
printfunctionInherited from Codec

Inherited from Codec

KindNameDescription
variablenameThe display name for this codec.
variableencoderThe encoder name for FFmpeg.
variablesampleRateThe sampling rate or RTP clock rate.
variablebitRateThe bit rate to encode at.
variablequalityOptional quality value, variable range depending on codec.
variablecomplianceFFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).
variableenabledWeather or not the codec is available for use.
variableoptionsArbitrary encoder options passed to FFmpeg via av_opt_set(). Keys are FFmpeg option names (e.g. "preset", "tune", "profile"). Applied after codec-specific defaults, so they override everything.
functionCodecConstruct a disabled codec with zeroed parameters.
functionCodecConstruct a codec with a display name, sample rate, bit rate, and enabled flag.
functionCodecConstruct a codec with an explicit FFmpeg encoder name.
function~Codec virtual noexceptCodec(const Codec& r);.
functiontoString virtual constReturn a compact string representation of this codec.
functionspecified constReturns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.
functionprint virtualPrint a multi-line human-readable description to the given stream.

Public Attributes

ReturnNameDescription
intchannels
std::stringsampleFmtOne of: u8, s16, s32, flt, dbl, u8p, s16p, s32p, fltp, dblp.

channels

int channels

Defined in src/av/include/icy/av/codec.h:104


sampleFmt

std::string sampleFmt

Defined in src/av/include/icy/av/codec.h:105

One of: u8, s16, s32, flt, dbl, u8p, s16p, s32p, fltp, dblp.

Public Methods

ReturnNameDescription
AudioCodecConstruct a disabled audio codec with zeroed parameters.
AudioCodecConstruct an anonymous audio codec from raw parameters.
AudioCodecConstruct a named audio codec.
AudioCodecConstruct a named audio codec with an explicit FFmpeg encoder name.
std::stringtoString virtual const override
voidprint virtual overridePrint a multi-line human-readable description to the given stream.

AudioCodec

AudioCodec()

Defined in src/av/include/icy/av/codec.h:108

Construct a disabled audio codec with zeroed parameters.


AudioCodec

AudioCodec(int channels, int sampleRate, const std::string & sampleFmt = "", int bitRate = 0)

Defined in src/av/include/icy/av/codec.h:115

Construct an anonymous audio codec from raw parameters.

Parameters

  • channels The number of audio channels.

  • sampleRate The sample rate in Hz.

  • sampleFmt The sample format string (e.g. "s16", "fltp").

  • bitRate The target bit rate in bits per second.


AudioCodec

AudioCodec(const std::string & name, int channels = 0, int sampleRate = 0, int bitRate = 0, const std::string & sampleFmt = "")

Defined in src/av/include/icy/av/codec.h:126

Construct a named audio codec.

Parameters

  • name The codec display name.

  • channels The number of audio channels.

  • sampleRate The sample rate in Hz.

  • bitRate The target bit rate in bits per second.

  • sampleFmt The sample format string.


AudioCodec

AudioCodec(const std::string & name, const std::string & encoder, int channels = 0, int sampleRate = 0, int bitRate = 0, const std::string & sampleFmt = "")

Defined in src/av/include/icy/av/codec.h:139

Construct a named audio codec with an explicit FFmpeg encoder name.

Parameters

  • name The codec display name.

  • encoder The FFmpeg encoder name (e.g. "libopus").

  • channels The number of audio channels.

  • sampleRate The sample rate in Hz.

  • bitRate The target bit rate in bits per second.

  • sampleFmt The sample format string.


toString

virtual const override

virtual std::string toString() const override

Defined in src/av/include/icy/av/codec.h:149

Returns

A string in the form "AudioCodec[name:encoder:sampleRate:bitRate:channels:sampleFmt:enabled]".

Reimplements

print

virtual override

virtual void print(std::ostream & ost) override

Defined in src/av/include/icy/av/codec.h:153

Print a multi-line human-readable description to the given stream.

Parameters

  • ost The output stream to write to.
Reimplements