Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -120,6 +120,21 @@ def process_audio(audio_filepath):
|
|
| 120 |
midifile = to_data_url(midifile)
|
| 121 |
return create_html_from_midi(midifile) # html midiplayer
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
@spaces.GPU
|
| 124 |
def process_video(youtube_url):
|
| 125 |
if 'youtu' not in youtube_url:
|
|
|
|
| 120 |
midifile = to_data_url(midifile)
|
| 121 |
return create_html_from_midi(midifile) # html midiplayer
|
| 122 |
|
| 123 |
+
# This is a temporary function for using pre-transcribed midi
|
| 124 |
+
@spaces.GPU
|
| 125 |
+
def process_audio_yt_temp(youtube_url):
|
| 126 |
+
if youtube_url is None:
|
| 127 |
+
return None
|
| 128 |
+
elif youtube_url == "https://youtu.be/5vJBhdjvVcE?si=s3NFG_SlVju0Iklg":
|
| 129 |
+
midifile = "./mid/Free Jazz Intro Music - Piano Sway (Intro B - 10 seconds) - OurMusicBox.mid"
|
| 130 |
+
elif youtube_url == "https://www.youtube.com/watch?v=bnS-HK_lTHA":
|
| 131 |
+
midifile = "./mid/Naomi Scott Speechless from Aladdin Official Video Sony vevo Music.mid"
|
| 132 |
+
elif youtube_url == "https://youtu.be/OXXRoa1U6xU?si=dpYMun4LjZHNydSb":
|
| 133 |
+
midifile = "./mid/Mozart_Sonata_for_Piano_and_Violin_(getmp3.pro).mid"
|
| 134 |
+
midifile = to_data_url(midifile)
|
| 135 |
+
return create_html_from_midi(midifile) # html midiplayer
|
| 136 |
+
|
| 137 |
+
|
| 138 |
@spaces.GPU
|
| 139 |
def process_video(youtube_url):
|
| 140 |
if 'youtu' not in youtube_url:
|