Audio Processing Improvements #17525
Merged
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.
This pull request introduces several improvements to the audio backend, focusing on more accurate and higher-quality audio processing, smoother transitions, and better volume control. The main changes include enhancements to volume application and normalization, improved resampler settings for higher audio fidelity, and more user-friendly volume adjustment behavior.
Audio Processing Improvements:
apply_volume_static, improving performance and precision when volume is unchanged or set to zero. Also, improved floating-point comparison inapply_volumeto avoid infinite loops and ensure accurate volume ramping. [1] [2]normalizeby introducing soft clipping for smoother distortion and better dynamic range handling, reducing harsh audio artifacts.Audio Quality Enhancements:
audio_resamplerto prioritize audio quality over latency by increasing sequence length, improving overlap and seeking window, disabling quick seek, and enabling anti-aliasing filtering.Volume Control Improvements:
audio_utils.cppfor more precise control at low volumes and faster adjustment at high volumes, resulting in a more natural user experience.Code Quality and Consistency:
AudioBackendto use consistent formatting and clearer logic, and increasedVOLUME_CHANGE_DURATIONfor smoother volume transitions. [1] [2] [3]