This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 33ffafa9296c060e2d9ef7d380acba81b471530b Author: caozilong1 <[email protected]> AuthorDate: Thu Jul 23 17:51:16 2026 +0800 audio: add Opus encoder options Add struct audio_enc_opus_s to union audio_codec_options_u, so that the Opus encoder settings are typed fields instead of the generic option string: the application ("voip", "audio" or "lowdelay"), the compression level and the frame duration. The application is kept as a name, which the encoder resolves from its own option table. The size of the union does not change. Signed-off-by: caozilong1 <[email protected]> --- include/nuttx/audio/audio.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/nuttx/audio/audio.h b/include/nuttx/audio/audio.h index 48dcabe24a1..55118d0e815 100644 --- a/include/nuttx/audio/audio.h +++ b/include/nuttx/audio/audio.h @@ -614,6 +614,13 @@ struct audio_enc_spx_s uint8_t compression_level; }; +struct audio_enc_opus_s +{ + char application[16]; + uint32_t compression_level; + float frame_duration; +}; + struct audio_enc_generic_s { uint32_t bw; @@ -674,6 +681,7 @@ union audio_codec_options_u struct audio_enc_sbc_s sbc; struct audio_enc_lc3_s lc3; struct audio_enc_spx_s spx; + struct audio_enc_opus_s opus; struct audio_enc_generic_s generic; struct audio_dec_flac_s flac_d; struct audio_dec_wma_s wma_d;
