Add more audio formats to native audio services - #1287
Merged
Conversation
This avoids downsampling audio to s16 when used in a processing pipeline
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. |
Contributor
There was a problem hiding this comment.
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_formatsin service metadata (.yml) forfilter_audiolevel,producer_tone, andproducer_noise. - Update
filter_audiolevelto measure levels from multiple audio formats using a format-aware sample accessor. - Update
producer_toneandproducer_noiseto generate audio in multiple formats (planar and interleaved), and usemlt_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.
Member
Author
Done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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