Skip to content

Commit

Permalink
Change default amplification_threshold to 0.0 (#151) (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamotsu authored Dec 8, 2024
1 parent 0fcf058 commit a58cb9a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,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

0 comments on commit a58cb9a

Please sign in to comment.