Skip to main content

symphonia_core/codecs/
audio.rs

1// Symphonia
2// Copyright (c) 2019-2026 The Project Symphonia Developers.
3//
4// This Source Code Form is subject to the terms of the Mozilla Public
5// License, v. 2.0. If a copy of the MPL was not distributed with this
6// file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
8//! Audio decoder specific support.
9
10use std::fmt;
11
12use crate::audio::sample::SampleFormat;
13use crate::audio::{Channels, GenericAudioBufferRef};
14use crate::codecs::{CodecInfo, CodecProfile};
15use crate::common::FourCc;
16use crate::errors::Result;
17use crate::packet::{Packet, PacketRef};
18
19/// An `AudioCodecId` is a unique identifier used to identify a specific audio codec.
20///
21/// # Creating a Codec ID
22///
23/// Using a [well-known](well_known) codec ID is *highly* recommended to maximize compatibility
24/// between components, libraries, and applications. However, if a codec requires custom codec ID,
25/// or there is no well-known ID, then the [`FourCc`] for the codec may be converted into a codec
26/// ID.
27#[repr(transparent)]
28#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
29pub struct AudioCodecId(u32);
30
31/// Null audio codec ID
32pub const CODEC_ID_NULL_AUDIO: AudioCodecId = AudioCodecId(0x0);
33
34impl Default for AudioCodecId {
35    fn default() -> Self {
36        CODEC_ID_NULL_AUDIO
37    }
38}
39
40impl AudioCodecId {
41    /// Create a new audio codec ID from a FourCC.
42    pub const fn new(cc: FourCc) -> AudioCodecId {
43        // A FourCc always only contains ASCII characters. Therefore, the upper bits are always 0.
44        Self(0x8000_0000 | u32::from_be_bytes(cc.get()))
45    }
46}
47
48impl From<FourCc> for AudioCodecId {
49    fn from(value: FourCc) -> Self {
50        AudioCodecId::new(value)
51    }
52}
53
54impl fmt::Display for AudioCodecId {
55    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
56        write!(f, "{:#x}", self.0)
57    }
58}
59
60/// A method and expected value to perform verification on the decoded audio.
61#[non_exhaustive]
62#[derive(Copy, Clone, Debug)]
63pub enum VerificationCheck {
64    /// CRC8 of interleaved PCM audio samples.
65    Crc8(u8),
66    /// CRC16 of interleaved PCM audio samples.
67    Crc16([u8; 2]),
68    /// CRC32 of interleaved PCM audio samples.
69    Crc32([u8; 4]),
70    /// MD5 of interleaved PCM audio samples.
71    Md5([u8; 16]),
72    /// Codec defined, up-to 16-byte code.
73    Other([u8; 16]),
74}
75
76/// Codec parameters for audio codecs.
77#[derive(Clone, Debug, Default)]
78pub struct AudioCodecParameters {
79    /// The codec ID.
80    pub codec: AudioCodecId,
81    /// The codec-defined profile.
82    pub profile: Option<CodecProfile>,
83    /// The sample rate of the audio in Hz.
84    pub sample_rate: Option<u32>,
85    /// The sample format of an audio sample.
86    pub sample_format: Option<SampleFormat>,
87    /// The number of bits per one decoded audio sample.
88    ///
89    /// This may be less-than the intrinsic bit-width of the data type of the decoded samples. In
90    /// such cases, any extra bits are 0 and shouldn't be considered as part of the sample. It will
91    /// never be greater-than the intrinsic bit-width of the sample data type.
92    pub bits_per_sample: Option<u32>,
93    /// The number of bits per one encoded audio sample.
94    ///
95    /// In rare cases where audio samples are encoded with fewer bits than the decoded
96    /// bits-per-sample, this indicates the number of bits per one encoded audio sample so that a
97    /// decoder may scale the sample to the correct number of bits. This will never be greater-than
98    /// the number of bits per decoded sample.
99    ///
100    /// If `None`, assumed to equal `bits_per_sample`.
101    pub bits_per_coded_sample: Option<u32>,
102    /// Audio channels.
103    pub channels: Option<Channels>,
104    /// The maximum number of frames a packet will contain.
105    pub max_frames_per_packet: Option<u64>,
106    /// A method and expected value that may be used to perform verification on the decoded audio.
107    pub verification_check: Option<VerificationCheck>,
108    /// The number of frames per block, in case packets are seperated in multiple blocks.
109    pub frames_per_block: Option<u64>,
110    /// Extra data (defined by the codec).
111    pub extra_data: Option<Box<[u8]>>,
112}
113
114impl AudioCodecParameters {
115    pub fn new() -> AudioCodecParameters {
116        AudioCodecParameters {
117            codec: CODEC_ID_NULL_AUDIO,
118            profile: None,
119            sample_rate: None,
120            sample_format: None,
121            bits_per_sample: None,
122            bits_per_coded_sample: None,
123            channels: None,
124            max_frames_per_packet: None,
125            verification_check: None,
126            frames_per_block: None,
127            extra_data: None,
128        }
129    }
130
131    /// Provide the `AudioCodecId`.
132    pub fn for_codec(&mut self, codec: AudioCodecId) -> &mut Self {
133        self.codec = codec;
134        self
135    }
136
137    /// Provide codec profile.
138    pub fn with_profile(&mut self, profile: CodecProfile) -> &mut Self {
139        self.profile = Some(profile);
140        self
141    }
142
143    /// Provide the sample rate in Hz.
144    pub fn with_sample_rate(&mut self, sample_rate: u32) -> &mut Self {
145        self.sample_rate = Some(sample_rate);
146        self
147    }
148
149    /// Provide the codec's decoded audio sample format.
150    pub fn with_sample_format(&mut self, sample_format: SampleFormat) -> &mut Self {
151        self.sample_format = Some(sample_format);
152        self
153    }
154
155    /// Provide the bit per sample of a decoded audio sample.
156    pub fn with_bits_per_sample(&mut self, bits_per_sample: u32) -> &mut Self {
157        self.bits_per_sample = Some(bits_per_sample);
158        self
159    }
160
161    /// Provide the bits per sample of an encoded audio sample.
162    pub fn with_bits_per_coded_sample(&mut self, bits_per_coded_sample: u32) -> &mut Self {
163        self.bits_per_coded_sample = Some(bits_per_coded_sample);
164        self
165    }
166
167    /// Provide the channel map.
168    pub fn with_channels(&mut self, channels: Channels) -> &mut Self {
169        self.channels = Some(channels);
170        self
171    }
172
173    /// Provide the maximum number of frames per packet.
174    pub fn with_max_frames_per_packet(&mut self, len: u64) -> &mut Self {
175        self.max_frames_per_packet = Some(len);
176        self
177    }
178
179    /// Provide the maximum number of frames per packet.
180    pub fn with_frames_per_block(&mut self, len: u64) -> &mut Self {
181        self.frames_per_block = Some(len);
182        self
183    }
184
185    /// Provide codec extra data.
186    pub fn with_extra_data(&mut self, data: Box<[u8]>) -> &mut Self {
187        self.extra_data = Some(data);
188        self
189    }
190
191    /// Provide a verification code of the final decoded audio.
192    pub fn with_verification_code(&mut self, code: VerificationCheck) -> &mut Self {
193        self.verification_check = Some(code);
194        self
195    }
196}
197
198/// `FinalizeResult` contains optional information that can only be found, calculated, or
199/// determined after decoding is complete.
200#[derive(Copy, Clone, Debug, Default)]
201pub struct FinalizeResult {
202    /// If verification is enabled and supported by the decoder, provides the verification result
203    /// if available.
204    pub verify_ok: Option<bool>,
205}
206
207/// `AudioDecoderOptions` is a common set of options that all audio decoders use.
208#[non_exhaustive]
209#[derive(Copy, Clone, Debug)]
210pub struct AudioDecoderOptions {
211    /// Enable support for gapless playback.
212    ///
213    /// When enabled, the decoder will trim any delay or padding frames.
214    ///
215    /// Default: `true`.
216    pub gapless: bool,
217    /// The decoded audio should be verified if possible during the decode process.
218    ///
219    /// Default: `false`.
220    pub verify: bool,
221}
222
223impl Default for AudioDecoderOptions {
224    fn default() -> Self {
225        Self { gapless: true, verify: false }
226    }
227}
228
229impl AudioDecoderOptions {
230    /// Enable or disable support for gapless playback.
231    ///
232    /// When enabled, the decoder will trim any delay or padding frames.
233    ///
234    /// Default: `true`.
235    pub fn gapless(mut self, enable: bool) -> Self {
236        self.gapless = enable;
237        self
238    }
239
240    /// Enable or disable decoded audio verification if the decoder supports it.
241    ///
242    /// Default: `false`.
243    pub fn verify(mut self, verify: bool) -> Self {
244        self.verify = verify;
245        self
246    }
247}
248
249/// An `AudioDecoder` implements an audio codec's decode algorithm. It consumes `Packet`s and
250/// produces buffers of PCM audio.
251pub trait AudioDecoder: Send + Sync {
252    /// Reset the decoder.
253    ///
254    /// A decoder must be reset when the next packet is discontinuous with respect to the last
255    /// decoded packet. Most notably, this occurs after a seek.
256    ///
257    /// # For Implementations
258    ///
259    /// For codecs that do a lot of pre-computation, reset should only reset the absolute minimum
260    /// amount of state.
261    fn reset(&mut self);
262
263    /// Get basic information about the codec.
264    fn codec_info(&self) -> &CodecInfo;
265
266    /// Gets a reference to an updated set of `AudioCodecParameters` based on the codec parameters
267    /// the decoder was instantiated with.
268    fn codec_params(&self) -> &AudioCodecParameters;
269
270    /// Decodes a `Packet` of audio data and returns a generic (untyped) audio buffer reference
271    /// containing the decoded audio.
272    ///
273    /// If a `DecodeError` or `IoError` is returned, the packet is undecodeable and should be
274    /// discarded. Decoding may be continued with the next packet. If `ResetRequired` is returned,
275    /// consumers of the decoded audio data should expect the duration and audio specification of
276    /// the decoded audio buffer to change. All other errors are unrecoverable.
277    ///
278    /// Implementors of decoders *must* `clear` the internal audio buffer if an error occurs.
279    fn decode(&mut self, packet: &Packet) -> Result<GenericAudioBufferRef<'_>> {
280        self.decode_ref(&packet.as_packet_ref())
281    }
282
283    /// Decodes a `PacketRef` of audio data and returns a generic (untyped) audio buffer reference
284    /// containing the decoded audio.
285    ///
286    /// This method is identical to `decode` but takes a `PacketRef` for zero-copy packet passing.
287    fn decode_ref(&mut self, packet: &PacketRef<'_>) -> Result<GenericAudioBufferRef<'_>>;
288
289    /// Optionally, obtain post-decode information such as the verification status.
290    fn finalize(&mut self) -> FinalizeResult;
291
292    /// Allows read access to the internal audio buffer.
293    ///
294    /// After a successful call to `decode`, this will contain the audio content of the last decoded
295    /// `Packet`. If the last call to `decode` resulted in an error, then implementors *must* ensure
296    /// the returned audio buffer has zero length.
297    fn last_decoded(&self) -> GenericAudioBufferRef<'_>;
298}
299
300/// Codec IDs and profiles for well-known audio codecs.
301pub mod well_known {
302    use super::AudioCodecId;
303
304    // Uncompressed PCM audio codecs
305    //------------------------------
306
307    /// PCM signed 32-bit little-endian interleaved
308    pub const CODEC_ID_PCM_S32LE: AudioCodecId = AudioCodecId(0x100);
309    /// PCM signed 32-bit little-endian planar
310    pub const CODEC_ID_PCM_S32LE_PLANAR: AudioCodecId = AudioCodecId(0x101);
311    /// PCM signed 32-bit big-endian interleaved
312    pub const CODEC_ID_PCM_S32BE: AudioCodecId = AudioCodecId(0x102);
313    /// PCM signed 32-bit big-endian planar
314    pub const CODEC_ID_PCM_S32BE_PLANAR: AudioCodecId = AudioCodecId(0x103);
315    /// PCM signed 24-bit little-endian interleaved
316    pub const CODEC_ID_PCM_S24LE: AudioCodecId = AudioCodecId(0x104);
317    /// PCM signed 24-bit little-endian planar
318    pub const CODEC_ID_PCM_S24LE_PLANAR: AudioCodecId = AudioCodecId(0x105);
319    /// PCM signed 24-bit big-endian interleaved
320    pub const CODEC_ID_PCM_S24BE: AudioCodecId = AudioCodecId(0x106);
321    /// PCM signed 24-bit big-endian planar
322    pub const CODEC_ID_PCM_S24BE_PLANAR: AudioCodecId = AudioCodecId(0x107);
323    /// PCM signed 16-bit little-endian interleaved
324    pub const CODEC_ID_PCM_S16LE: AudioCodecId = AudioCodecId(0x108);
325    /// PCM signed 16-bit little-endian planar
326    pub const CODEC_ID_PCM_S16LE_PLANAR: AudioCodecId = AudioCodecId(0x109);
327    /// PCM signed 16-bit big-endian interleaved
328    pub const CODEC_ID_PCM_S16BE: AudioCodecId = AudioCodecId(0x10a);
329    /// PCM signed 16-bit big-endian planar
330    pub const CODEC_ID_PCM_S16BE_PLANAR: AudioCodecId = AudioCodecId(0x10b);
331    /// PCM signed 8-bit interleaved
332    pub const CODEC_ID_PCM_S8: AudioCodecId = AudioCodecId(0x10c);
333    /// PCM signed 8-bit planar
334    pub const CODEC_ID_PCM_S8_PLANAR: AudioCodecId = AudioCodecId(0x10d);
335    /// PCM unsigned 32-bit little-endian interleaved
336    pub const CODEC_ID_PCM_U32LE: AudioCodecId = AudioCodecId(0x10e);
337    /// PCM unsigned 32-bit little-endian planar
338    pub const CODEC_ID_PCM_U32LE_PLANAR: AudioCodecId = AudioCodecId(0x10f);
339    /// PCM unsigned 32-bit big-endian interleaved
340    pub const CODEC_ID_PCM_U32BE: AudioCodecId = AudioCodecId(0x110);
341    /// PCM unsigned 32-bit big-endian planar
342    pub const CODEC_ID_PCM_U32BE_PLANAR: AudioCodecId = AudioCodecId(0x111);
343    /// PCM unsigned 24-bit little-endian interleaved
344    pub const CODEC_ID_PCM_U24LE: AudioCodecId = AudioCodecId(0x112);
345    /// PCM unsigned 24-bit little-endian planar
346    pub const CODEC_ID_PCM_U24LE_PLANAR: AudioCodecId = AudioCodecId(0x113);
347    /// PCM unsigned 24-bit big-endian interleaved
348    pub const CODEC_ID_PCM_U24BE: AudioCodecId = AudioCodecId(0x114);
349    /// PCM unsigned 24-bit big-endian planar
350    pub const CODEC_ID_PCM_U24BE_PLANAR: AudioCodecId = AudioCodecId(0x115);
351    /// PCM unsigned 16-bit little-endian interleaved
352    pub const CODEC_ID_PCM_U16LE: AudioCodecId = AudioCodecId(0x116);
353    /// PCM unsigned 16-bit little-endian planar
354    pub const CODEC_ID_PCM_U16LE_PLANAR: AudioCodecId = AudioCodecId(0x117);
355    /// PCM unsigned 16-bit big-endian interleaved
356    pub const CODEC_ID_PCM_U16BE: AudioCodecId = AudioCodecId(0x118);
357    /// PCM unsigned 16-bit big-endian planar
358    pub const CODEC_ID_PCM_U16BE_PLANAR: AudioCodecId = AudioCodecId(0x119);
359    /// PCM unsigned 8-bit interleaved
360    pub const CODEC_ID_PCM_U8: AudioCodecId = AudioCodecId(0x11a);
361    /// PCM unsigned 8-bit planar
362    pub const CODEC_ID_PCM_U8_PLANAR: AudioCodecId = AudioCodecId(0x11b);
363    /// PCM 32-bit little-endian floating point interleaved
364    pub const CODEC_ID_PCM_F32LE: AudioCodecId = AudioCodecId(0x11c);
365    /// PCM 32-bit little-endian floating point planar
366    pub const CODEC_ID_PCM_F32LE_PLANAR: AudioCodecId = AudioCodecId(0x11d);
367    /// PCM 32-bit big-endian floating point interleaved
368    pub const CODEC_ID_PCM_F32BE: AudioCodecId = AudioCodecId(0x11e);
369    /// PCM 32-bit big-endian floating point planar
370    pub const CODEC_ID_PCM_F32BE_PLANAR: AudioCodecId = AudioCodecId(0x11f);
371    /// PCM 64-bit little-endian floating point interleaved
372    pub const CODEC_ID_PCM_F64LE: AudioCodecId = AudioCodecId(0x120);
373    /// PCM 64-bit little-endian floating point planar
374    pub const CODEC_ID_PCM_F64LE_PLANAR: AudioCodecId = AudioCodecId(0x121);
375    /// PCM 64-bit big-endian floating point interleaved
376    pub const CODEC_ID_PCM_F64BE: AudioCodecId = AudioCodecId(0x122);
377    /// PCM 64-bit big-endian floating point planar
378    pub const CODEC_ID_PCM_F64BE_PLANAR: AudioCodecId = AudioCodecId(0x123);
379    /// PCM A-law (G.711)
380    pub const CODEC_ID_PCM_ALAW: AudioCodecId = AudioCodecId(0x124);
381    /// PCM Mu-law (G.711)
382    pub const CODEC_ID_PCM_MULAW: AudioCodecId = AudioCodecId(0x125);
383
384    // ADPCM audio codecs
385    //-------------------
386
387    /// G.722 ADPCM
388    pub const CODEC_ID_ADPCM_G722: AudioCodecId = AudioCodecId(0x200);
389    /// G.726 ADPCM
390    pub const CODEC_ID_ADPCM_G726: AudioCodecId = AudioCodecId(0x201);
391    /// G.726 ADPCM little-endian
392    pub const CODEC_ID_ADPCM_G726LE: AudioCodecId = AudioCodecId(0x202);
393    /// Microsoft ADPCM
394    pub const CODEC_ID_ADPCM_MS: AudioCodecId = AudioCodecId(0x203);
395    /// ADPCM IMA WAV
396    pub const CODEC_ID_ADPCM_IMA_WAV: AudioCodecId = AudioCodecId(0x204);
397    /// ADPCM IMA QuickTime
398    pub const CODEC_ID_ADPCM_IMA_QT: AudioCodecId = AudioCodecId(0x205);
399
400    // Compressed lossy audio codecs
401    //------------------------------
402
403    /// Vorbis
404    pub const CODEC_ID_VORBIS: AudioCodecId = AudioCodecId(0x1000);
405    /// Opus
406    pub const CODEC_ID_OPUS: AudioCodecId = AudioCodecId(0x1001);
407    /// Speex
408    pub const CODEC_ID_SPEEX: AudioCodecId = AudioCodecId(0x1002);
409    /// Musepack
410    pub const CODEC_ID_MUSEPACK: AudioCodecId = AudioCodecId(0x1003);
411    /// MPEG Layer 1 (MP1)
412    pub const CODEC_ID_MP1: AudioCodecId = AudioCodecId(0x1004);
413    /// MPEG Layer 2 (MP2)
414    pub const CODEC_ID_MP2: AudioCodecId = AudioCodecId(0x1005);
415    /// MPEG Layer 3 (MP3)
416    pub const CODEC_ID_MP3: AudioCodecId = AudioCodecId(0x1006);
417    /// Advanced Audio Coding (AAC)
418    pub const CODEC_ID_AAC: AudioCodecId = AudioCodecId(0x1007);
419    /// AC-3 (Dolby Digital, ATSC A/52A)
420    pub const CODEC_ID_AC3: AudioCodecId = AudioCodecId(0x1008);
421    /// Enhanced AC-3 (EAC-3, ATSC A/52B)
422    pub const CODEC_ID_EAC3: AudioCodecId = AudioCodecId(0x1009);
423    /// Dolby AC-4 (ETSI TS 103 190)
424    pub const CODEC_ID_AC4: AudioCodecId = AudioCodecId(0x100a);
425    /// DTS Coherent Acoustics (DCA/DTS)
426    pub const CODEC_ID_DCA: AudioCodecId = AudioCodecId(0x100b);
427    /// Adaptive Transform Acoustic Coding (ATRAC1)
428    pub const CODEC_ID_ATRAC1: AudioCodecId = AudioCodecId(0x100c);
429    /// Adaptive Transform Acoustic Coding 3 (ATRAC3)
430    pub const CODEC_ID_ATRAC3: AudioCodecId = AudioCodecId(0x100d);
431    /// Adaptive Transform Acoustic Coding 3+ (ATRAC3+)
432    pub const CODEC_ID_ATRAC3PLUS: AudioCodecId = AudioCodecId(0x100e);
433    /// Adaptive Transform Acoustic Coding 9 (ATRAC9)
434    pub const CODEC_ID_ATRAC9: AudioCodecId = AudioCodecId(0x100f);
435    /// Windows Media Audio
436    pub const CODEC_ID_WMA: AudioCodecId = AudioCodecId(0x1010);
437    /// RealAudio 1.0 14.4K (IS-54 VSELP)
438    pub const CODEC_ID_RA10: AudioCodecId = AudioCodecId(0x1011);
439    /// RealAudio 2.0 28.8K (G.728 LD-CELP)
440    pub const CODEC_ID_RA20: AudioCodecId = AudioCodecId(0x1012);
441    /// SIPR (ACELP.net, RealAudio 4.0/5.0)
442    pub const CODEC_ID_SIPR: AudioCodecId = AudioCodecId(0x1013);
443    /// Cook, Cooker, Gecko (RealAudio 6.0/G2)
444    pub const CODEC_ID_COOK: AudioCodecId = AudioCodecId(0x1014);
445    /// Low-complexity Subband Coding (SBC)
446    pub const CODEC_ID_SBC: AudioCodecId = AudioCodecId(0x1015);
447    /// aptX
448    pub const CODEC_ID_APTX: AudioCodecId = AudioCodecId(0x1016);
449    /// aptX HD
450    pub const CODEC_ID_APTX_HD: AudioCodecId = AudioCodecId(0x1017);
451    /// Lossless Digital Audio Codec (LDAC)
452    pub const CODEC_ID_LDAC: AudioCodecId = AudioCodecId(0x1018);
453    /// Bink Audio
454    pub const CODEC_ID_BINK_AUDIO: AudioCodecId = AudioCodecId(0x1019);
455    /// Smacker Audio
456    pub const CODEC_ID_SMACKER_AUDIO: AudioCodecId = AudioCodecId(0x1020);
457
458    // Compressed lossless audio codecs
459    //---------------------------------
460
461    /// Free Lossless Audio Codec (FLAC)
462    pub const CODEC_ID_FLAC: AudioCodecId = AudioCodecId(0x2000);
463    /// WavPack
464    pub const CODEC_ID_WAVPACK: AudioCodecId = AudioCodecId(0x2001);
465    /// Monkey's Audio (APE)
466    pub const CODEC_ID_MONKEYS_AUDIO: AudioCodecId = AudioCodecId(0x2002);
467    /// Apple Lossless Audio Codec (ALAC)
468    pub const CODEC_ID_ALAC: AudioCodecId = AudioCodecId(0x2003);
469    /// True Audio (TTA)
470    pub const CODEC_ID_TTA: AudioCodecId = AudioCodecId(0x2004);
471    /// RealAudio Lossless Format (RALF)
472    pub const CODEC_ID_RALF: AudioCodecId = AudioCodecId(0x2005);
473    /// Dolby TrueHD Lossless codec
474    pub const CODEC_ID_TRUEHD: AudioCodecId = AudioCodecId(0x2006);
475
476    /// Codec profiles for well-known audio codecs.
477    pub mod profiles {
478        use crate::codecs::CodecProfile;
479
480        // AAC Profiles
481        //-------------
482
483        // AAC profiles are defined to be the MPEG-4 Audio Object Type minus 1 (as per ADTS).
484
485        /// AAC Main Profile
486        pub const CODEC_PROFILE_AAC_MAIN: CodecProfile = CodecProfile(0);
487        /// AAC Low Complexity (LC) Profile
488        pub const CODEC_PROFILE_AAC_LC: CodecProfile = CodecProfile(1);
489        /// AAC Scalable Sample Rate (SSR) Profile
490        pub const CODEC_PROFILE_AAC_SSR: CodecProfile = CodecProfile(2);
491        /// AAC Long Term Prediction (LTP) Profile
492        pub const CODEC_PROFILE_AAC_LTP: CodecProfile = CodecProfile(3);
493        /// High Efficiency AAC (HE-AAC) Profile (using Spectral Band Replication)
494        pub const CODEC_PROFILE_AAC_HE: CodecProfile = CodecProfile(4);
495        /// High Efficiency AAC v2 (HE-AACv2) Profile (using Parametric Stereo)
496        pub const CODEC_PROFILE_AAC_HE_V2: CodecProfile = CodecProfile(28);
497        /// Extended HE-AAC (xHE-AAC) Profile (using Unified Speech and Audio Coding)
498        pub const CODEC_PROFILE_AAC_USAC: CodecProfile = CodecProfile(41);
499    }
500}