Change default audio format to float32 (#1284) - #1285
Merged
Conversation
Member
Author
|
@bmatherly This also works in Shotcut after one small change for the peak and waveform meters, which assume 16-bit int diff --git a/src/sharedframe.cpp b/src/sharedframe.cpp
index 1c5255e0..cb5910eb 100644
--- a/src/sharedframe.cpp
+++ b/src/sharedframe.cpp
@@ -253,7 +253,8 @@ int SharedFrame::get_audio_samples() const
const int16_t *SharedFrame::get_audio() const
{
- mlt_audio_format format = get_audio_format();
+ // Scope widgets reading through SharedFrame currently consume signed 16-bit PCM.
+ mlt_audio_format format = mlt_audio_s16;
int frequency = get_audio_frequency();
int channels = get_audio_channels();
int samples = get_audio_samples(); |
Contributor
There was a problem hiding this comment.
Pull request overview
Changes default and realtime consumer audio paths from S16 to interleaved float32.
Changes:
- Sets the framework default to
f32le. - Updates SDL2 consumers for float32 playback and volume handling.
- Updates RtAudio streams and buffers for float32.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/framework/mlt_consumer.c |
Changes the default audio format and preserves explicit S16 selection. |
src/modules/sdl2/consumer_sdl2.c |
Uses float32 audio with SDL2. |
src/modules/sdl2/consumer_sdl2_audio.c |
Converts audio-only SDL2 playback to float32. |
src/modules/rtaudio/consumer_rtaudio.cpp |
Converts RtAudio playback to float32. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
And fix it is hard-coded at s16.
Member
Thanks for letting me know. I will come up with a general solution for this in Shotcut. |
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.
Uh oh!
There was an error while loading. Please reload this page.