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

small fix in aria.utils #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions aria/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
from pydub import AudioSegment



def midi_to_audio(mid_path: str, soundfont_path: str | None = None):
SOUNDFONT_PATH = os.path.join(
os.path.dirname(__file__),
"..",
"fluidsynth/DoreMarkYamahaS6-v1.6.sf2",
)
here = os.path.dirname(__file__)
FLUIDSYNTH_DIR = os.path.join(here, "..", "fluidsynth")
SOUNDFONT_PATH = os.path.join(FLUIDSYNTH_DIR, "DoreMarkYamahaS6-v1.6.sf2")
DOWNLOAD_URL = "https://www.dropbox.com/scl/fi/t8gou8stesm42sc559nzu/DoreMarkYamahaS6-v1.6.sf2?rlkey=28ecl63kkjjmwxrkd6hnzsq8f&dl=1"

if os.name != "posix":
Expand All @@ -24,8 +23,9 @@ def midi_to_audio(mid_path: str, soundfont_path: str | None = None):
"fluidsynth soundfont missing, type Y to download and continue: "
)
if _input == "Y":
if not os.path.isdir("fluidsynth"):
os.mkdir("fluidsynth")
if not os.path.isdir(FLUIDSYNTH_DIR):
print(f"making dir: {FLUIDSYNTH_DIR}")
os.mkdir(FLUIDSYNTH_DIR)

res = requests.get(url=DOWNLOAD_URL)
if res.status_code == 200:
Expand Down