Repository: gradio-app/gradio

Issue:
Audio get louder when trimmed
### Describe the bug

It seems the audio volume goes up every time you crop it as you can hear in the following video:

https://github.com/gradio-app/gradio/assets/25161192/fdcacb28-c5a6-47e6-bfe6-c516d2385c70



### Have you searched existing issues?  🔎

- [X] I have searched and found no existing issues

### Reproduction


```py
import gradio as gr

gr.Interface(fn=lambda x: x, inputs='audio', outputs='audio').queue().launch()
```

### Screenshot

_No response_

### Logs

_No response_

### System Info

```shell
gradio==4.1.2
```


### Severity

I can work around it


Discussion:
Ah, I thought this is a different issue, but actually, I think this is the same issue I opened before. I thought trimming corrupted the audio when I opened #6206 but it seems the real issue is that audio gets louder. I guess I'll close #6206 in favor of this.

Resolving patch:
diff --git a/gradio/components/audio.py b/gradio/components/audio.py
--- a/gradio/components/audio.py
+++ b/gradio/components/audio.py
@@ -24,7 +24,8 @@ class WaveformOptions:
     A dataclass for specifying options for the waveform display in the Audio component. An instance of this class can be passed into the `waveform_options` parameter of `gr.Audio`.
     Parameters:
         waveform_color: The color (as a hex string or valid CSS color) of the full waveform representing the amplitude of the audio. Defaults to a light gray color.
-        waveform_progress_color: The color (as a hex string or valid CSS color) that the waveform fills with to as the audio plays. Defaults to an orange color.
+        waveform_progress_color: The color (as a hex string or valid CSS color) that the waveform fills with to as the audio plays. Defaults to the accent color.
+        trim_region_color: The color (as a hex string or valid CSS color) of the trim region. Defaults to the accent color.
         show_recording_waveform: Whether to show the waveform when recording audio. Defaults to True.
         show_controls: Whether to show the standard HTML audio player below the waveform when recording audio or playing recorded audio. Defaults to False.
         skip_length: The percentage (between 0 and 100) of the audio to skip when clicking on the skip forward / skip backward buttons. Defaults to 5.
@@ -33,6 +34,7 @@ class WaveformOptions:
 
     waveform_color: str | None = None
     waveform_progress_color: str | None = None
+    trim_region_color: str | None = None
     show_recording_waveform: bool = True
     show_controls: bool = False
     skip_length: int | float = 5
@@ -118,7 +120,7 @@ def __init__(
             editable: If True, allows users to manipulate the audio file if the component is interactive. Defaults to True.
             min_length: The minimum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no minimum length.
             max_length: The maximum length of audio (in seconds) that the user can pass into the prediction function. If None, there is no maximum length.
-            waveform_options: A dictionary of options for the waveform display. Options include: waveform_color (str), waveform_progress_color (str), show_controls (bool), skip_length (int). Default is None, which uses the default values for these options.
+            waveform_options: A dictionary of options for the waveform display. Options include: waveform_color (str), waveform_progress_color (str), show_controls (bool), skip_length (int), trim_region_color (str). Default is None, which uses the default values for these options.
         """
         valid_sources: list[Literal["upload", "microphone"]] = ["upload", "microphone"]
         if sources is None:


Test patch:
diff --git a/test/test_components.py b/test/test_components.py
--- a/test/test_components.py
+++ b/test/test_components.py
@@ -844,6 +844,7 @@ def test_component_functions(self, gradio_temp_dir):
                 "skip_length": 5,
                 "waveform_color": None,
                 "waveform_progress_color": None,
+                "trim_region_color": None,
             },
             "_selectable": False,
         }
@@ -897,6 +898,7 @@ def test_component_functions(self, gradio_temp_dir):
                 "skip_length": 5,
                 "waveform_color": None,
                 "waveform_progress_color": None,
+                "trim_region_color": None,
             },
             "_selectable": False,
         }