Skip to content

Spatializer: Add configurable presets for reverb settings

Benny perumalla requested to merge features into master

This merge request introduces a user-friendly preset system to the Audio Spatializer filter, improving usability by allowing users to quickly select from a range of pre-configured reverb environments.

Motivation

The existing spatializer filter requires users to manually adjust five different sliders (Room Size, Width, Wet, Dry, Damp) to achieve a desired sound. This can be unintuitive and time-consuming for users who are not familiar with audio engineering principles. The goal of this change is to simplify the user experience by providing a set of common, well-understood acoustic environments as starting points, making the feature more accessible.

Solution

A new preset system has been implemented that adds a dropdown menu to the filter's configuration panel. Users can now select from environments like "Auditorium," "Great Hall," or "Small Room." Selecting a preset automatically configures the underlying parameters. here is the guide A_Guide_to_Spatializer_and_Reverb_Settings.pdf

Core changes include:

New Presets Library (spatializer_presets.h)

  • A new header file has been created to define and store the parameter values for eight distinct reverb presets.
  • These values are derived from established audio engineering guidelines for simulating different acoustic spaces.

UI and Logic Integration (spatializer.cpp)

  • A dropdown menu (spatializer-preset) has been added to the VLC interface, populated with the new presets and a "Custom" option.
  • Selecting a preset from the dropdown automatically updates the five corresponding sliders to the pre-configured values.
  • The "Custom" option is automatically selected whenever a user manually adjusts any of the individual sliders, preserving their ability to fine-tune the effect.

Callback and State Management

  • A new callback (PresetCallback) handles the logic for applying preset values to the UI and the audio engine.
  • Existing slider callbacks have been updated to set the preset dropdown to "Custom" upon manual adjustment, providing clear feedback to the user.
  • The filter's Open and Close functions have been updated to correctly manage the new configuration option, its callback, and the persistence of user settings.

How to Test This Change

  1. Compile VLC with the updated code.
  2. Open any media file with an audio track.
  3. Navigate to Tools > Effects and Filters > Audio Effects > Spatializer.
  4. Enable the filter by checking the box.
  5. Observe the new "Preset" dropdown menu.
  6. Select a preset from the list (e.g., "Great Hall").
    • Verify: The "Room size," "Width," "Wet," "Dry," and "Damp" sliders should automatically update to new values.
    • Listen: The audio's reverb characteristics should change noticeably to reflect the selected environment.
  7. Manually adjust one of the sliders (e.g., move "Wet").
    • Verify: The "Preset" dropdown should automatically switch to "Custom."
  8. Select another preset, then close the Effects window.
  9. Re-open the Effects window and navigate back to the Spatializer.
    • Verify: The last selected preset and its corresponding slider values should be correctly restored.

This MR enhances the usability of the spatializer filter, making a powerful audio effect more accessible to all VLC users.

Merge request reports

Loading