Skip to content

Add more audio formats to native audio services - #1287

Merged
bmatherly merged 4 commits into
masterfrom
audio_float
Aug 29, 2026
Merged

Add more audio formats to native audio services#1287
bmatherly merged 4 commits into
masterfrom
audio_float

Conversation

@bmatherly

Copy link
Copy Markdown
Member

In particular, avoid situations where a filter might constrain the format to S16.

I am unsure if consumer_multi is a good candidate to add more formats. It currently only supports S16

This avoids downsampling audio to s16 when used in a processing
pipeline
@ddennedy

Copy link
Copy Markdown
Member

I would prefer audiolevel only to minimize impact. I will change consumer multi in my branch since it is related. Thanks for mentioning it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the set of supported audio sample formats for a few native audio services so they no longer unnecessarily force s16 (notably improving interoperability and reducing avoidable conversions in audio pipelines).

Changes:

  • Advertise additional supported audio_formats in service metadata (.yml) for filter_audiolevel, producer_tone, and producer_noise.
  • Update filter_audiolevel to measure levels from multiple audio formats using a format-aware sample accessor.
  • Update producer_tone and producer_noise to generate audio in multiple formats (planar and interleaved), and use mlt_audio_format_size() for allocation sizing.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/modules/normalize/filter_audiolevel.yml Adds more advertised audio formats for the audiolevel filter.
src/modules/normalize/filter_audiolevel.c Adds multi-format sample reading and stops forcing output to s16.
src/modules/core/producer_tone.yml Expands advertised output audio formats for tone producer.
src/modules/core/producer_tone.c Generates tone audio in multiple formats and sizes buffers via mlt_audio_format_size().
src/modules/core/producer_noise.yml Expands advertised output audio formats for noise producer.
src/modules/core/producer_noise.c Generates noise audio in multiple formats and computes per-frame sample count when needed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/modules/normalize/filter_audiolevel.c Outdated
Comment thread src/modules/core/producer_tone.c Outdated
@bmatherly

Copy link
Copy Markdown
Member Author

I would prefer audiolevel only to minimize impact.

Done

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/modules/normalize/filter_audiolevel.c Outdated
@bmatherly
bmatherly merged commit b48a6ec into master Aug 29, 2026
15 checks passed
@bmatherly
bmatherly deleted the audio_float branch August 29, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants