Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default amplification_threshold to 0.0 #153

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ You can also rename specific stems:
- output_dir: (Optional) Directory where the separated files will be saved. If not specified, uses the current directory.
- output_format: (Optional) Format to encode output files, any common format (WAV, MP3, FLAC, M4A, etc.). Default: WAV
- normalization_threshold: (Optional) The amount by which the amplitude of the output audio will be multiplied. Default: 0.9
- amplification_threshold: (Optional) The minimum amplitude level at which the waveform will be amplified. If the peak amplitude of the audio is below this threshold, the waveform will be scaled up to meet it. Default: 0.6
- amplification_threshold: (Optional) The minimum amplitude level at which the waveform will be amplified. If the peak amplitude of the audio is below this threshold, the waveform will be scaled up to meet it. Default: 0.0
- output_single_stem: (Optional) Output only a single stem, such as 'Instrumental' and 'Vocals'. Default: None
- invert_using_spec: (Optional) Flag to invert using spectrogram. Default: False
- sample_rate: (Optional) Set the sample rate of the output audio. Default: 44100
Expand Down
6 changes: 3 additions & 3 deletions audio_separator/separator/separator.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(
output_format="WAV",
output_bitrate=None,
normalization_threshold=0.9,
amplification_threshold=0.6,
amplification_threshold=0.0,
output_single_stem=None,
invert_using_spec=False,
sample_rate=44100,
Expand Down Expand Up @@ -142,8 +142,8 @@ def __init__(
raise ValueError("The normalization_threshold must be greater than 0 and less than or equal to 1.")

self.amplification_threshold = amplification_threshold
if amplification_threshold <= 0 or amplification_threshold > 1:
raise ValueError("The amplification_threshold must be greater than 0 and less than or equal to 1.")
if amplification_threshold < 0 or amplification_threshold > 1:
raise ValueError("The amplification_threshold must be greater than or equal to 0 and less than or equal to 1.")

self.output_single_stem = output_single_stem
if output_single_stem is not None:
Expand Down
2 changes: 1 addition & 1 deletion audio_separator/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def main():
common_params = parser.add_argument_group("Common Separation Parameters")
common_params.add_argument("--invert_spect", action="store_true", help=invert_spect_help)
common_params.add_argument("--normalization", type=float, default=0.9, help=normalization_help)
common_params.add_argument("--amplification", type=float, default=0.6, help=amplification_help)
common_params.add_argument("--amplification", type=float, default=0.0, help=amplification_help)
common_params.add_argument("--single_stem", default=None, help=single_stem_help)
common_params.add_argument("--sample_rate", type=int, default=44100, help=sample_rate_help)
common_params.add_argument("--use_soundfile", action="store_true", help=use_soundfile_help)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def common_expected_args():
"output_format": "FLAC",
"output_bitrate": None,
"normalization_threshold": 0.9,
"amplification_threshold": 0.6,
"amplification_threshold": 0.0,
"output_single_stem": None,
"invert_using_spec": False,
"sample_rate": 44100,
Expand Down
Loading