AV module

AudioCodec

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

AudioCodec

#include <icy/av/codec.h>

Inherits: Codec

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

Public Attributes

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

channels

int channels

sampleFmt

std::string sampleFmt

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#### Returns
voidprint virtualPrint a multi-line human-readable description to the given stream.

AudioCodec

AudioCodec()

Construct a disabled audio codec with zeroed parameters.


AudioCodec

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

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, int sampleRate, int bitRate, const std::string & sampleFmt)

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, int sampleRate, int bitRate, const std::string & sampleFmt)

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

virtual std::string toString() const

Returns

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


print

virtual

virtual void print(std::ostream & ost)

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

Parameters

  • ost The output stream to write to.