AudioCodec
AudioCodec
#include <icy/av/codec.h>Inherits:
Codec
Audio codec parameters including channels, sample rate, and sample format.
Public Attributes
| Return | Name | Description |
|---|---|---|
int | channels | |
std::string | sampleFmt | One of: u8, s16, s32, flt, dbl, u8p, s16p, s32p, fltp, dblp. |
channels
int channelssampleFmt
std::string sampleFmtOne of: u8, s16, s32, flt, dbl, u8p, s16p, s32p, fltp, dblp.
Public Methods
| Return | Name | Description |
|---|---|---|
AudioCodec | Construct a disabled audio codec with zeroed parameters. | |
AudioCodec | Construct an anonymous audio codec from raw parameters. | |
AudioCodec | Construct a named audio codec. | |
AudioCodec | Construct a named audio codec with an explicit FFmpeg encoder name. | |
std::string | toString virtual const | #### Returns |
void | print virtual | Print 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
channelsThe number of audio channels.sampleRateThe sample rate in Hz.sampleFmtThe sample format string (e.g. "s16", "fltp").bitRateThe 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
nameThe codec display name.channelsThe number of audio channels.sampleRateThe sample rate in Hz.bitRateThe target bit rate in bits per second.sampleFmtThe 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
nameThe codec display name.encoderThe FFmpeg encoder name (e.g. "libopus").channelsThe number of audio channels.sampleRateThe sample rate in Hz.bitRateThe target bit rate in bits per second.sampleFmtThe sample format string.
toString
virtual const
virtual std::string toString() constReturns
A string in the form "AudioCodec[name:encoder:sampleRate:bitRate:channels:sampleFmt:enabled]".
virtual
virtual void print(std::ostream & ost)Print a multi-line human-readable description to the given stream.
Parameters
ostThe output stream to write to.
