Skip to content

Commit

Permalink
fix: remove resampling option from new-project wizard
Browse files Browse the repository at this point in the history
Fixes #341
  • Loading branch information
joanise committed Jun 11, 2024
1 parent 7b80f1a commit bd0c372
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions everyvoice/tests/test_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@ def find_step(name: Enum, steps: Sequence[Step]):

sox_effects_step = find_step(SN.sox_effects_step, tour.steps)
# 0 is resample to 22050 kHz, 2 is remove silence at start and end
with patch_menu_prompt([0, 2]):
with patch_menu_prompt([0, 1]):
sox_effects_step.run()
# print(sox_effects_step.state["sox_effects"])
self.assertEqual(
sox_effects_step.state["sox_effects"],
[
["channels", "1"],
["rate", "22050"],
["norm", "-3.0"],
[
"silence",
"1",
Expand Down
15 changes: 4 additions & 11 deletions everyvoice/wizard/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ def prompt(self):
return get_response_from_menu_prompt(
prompt_text="Which of the following audio preprocessing options would you like to apply?",
choices=(
"Resample to suggested sample rate: 22050 kHz",
"Normalization (-3.0dB)",
"Remove Silence at start and end",
"Remove Silence throughout",
Expand All @@ -581,9 +580,8 @@ def validate(self, response):

def effect(self):
audio_effects = {
0: ["rate", "22050"],
1: ["norm", "-3.0"],
2: [
0: [["norm", "-3.0"]],
1: [
[
"silence",
"1",
Expand All @@ -596,17 +594,12 @@ def effect(self):
"reverse"
], # reverse the clip again to revert to the right direction :)
],
3: ["silence", "1", "0.1", "1.0%", "-1", "0.4", "1%"],
2: [["silence", "1", "0.1", "1.0%", "-1", "0.4", "1%"]],
}
self.state["sox_effects"] = [["channels", "1"]]
if self.response:
for effect in self.response:
if (
effect == 2
): # trimming leading and trailing silence is now a list of lists.
self.state["sox_effects"] += audio_effects[effect]
else:
self.state["sox_effects"].append(audio_effects[effect])
self.state["sox_effects"] += audio_effects[effect]


class SymbolSetStep(Step):
Expand Down

0 comments on commit bd0c372

Please sign in to comment.