Interface IAudioEncoder
Represents an interface for audio encoders, providing properties specific to audio encoding such as sample rate, format, and channel layout. Inherits from IEncoderContext for general encoding options.
Inherited Members
Namespace: FFmpeg.Codecs
Assembly: FFmpeg.dll
Syntax
public interface IAudioEncoder : IEncoderContext, IDisposable, IOptionQueryable
Properties
View SourceAudioServiceType
Gets or sets the audio service type, which indicates the type of audio being encoded (e.g., main audio, commentary, hearing impaired audio).
This is mainly used for broadcasting or streaming services that require different types of audio streams for various audiences.
Declaration
AudioServiceType AudioServiceType { get; set; }
Property Value
| Type | Description |
|---|---|
| AudioServiceType |
ChannelLayout
Gets or sets the channel layout of the audio being encoded.
The channel layout describes how audio channels (e.g., mono, stereo, surround) are arranged. This is typically set according to the source material (e.g., stereo layout for two channels).
Declaration
ChannelLayout_ref ChannelLayout { get; }
Property Value
| Type | Description |
|---|---|
| ChannelLayout_ref |
SampleFormat
Gets or sets the sample format of the audio being encoded.
The sample format defines how each audio sample is represented (e.g., 16-bit integer, floating point). This property must be set based on the audio source's format.
Declaration
SampleFormat SampleFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| SampleFormat |
SampleRate
Gets or sets the sample rate of the audio being encoded, in samples per second (Hz).
The sample rate defines how many audio samples are taken per second. Common values are 44100 Hz (CD quality) and 48000 Hz (professional audio).
Declaration
int SampleRate { get; set; }
Property Value
| Type | Description |
|---|---|
| int |