juancopi81 commited on
Commit
089aaf1
1 Parent(s): be33ae4

Return path to file in get_audio

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -43,7 +43,8 @@ def get_audio(url):
43
  ten_seconds = 10 * 1000
44
  first_10_seconds = wav_to_cut[:ten_seconds]
45
  os.remove(new_file)
46
- return first_10_seconds
 
47
 
48
  # Credits https://huggingface.co/spaces/jeffistyping/Youtube-Whisperer
49
  def populate_metadata(link):
@@ -61,6 +62,11 @@ def inference(audio):
61
 
62
  note_seq.sequence_proto_to_midi_file(est_ns, "./transcribed.mid")
63
 
 
 
 
 
 
64
  return "./transcribed.mid"
65
 
66
  title = "Transcribe music from YouTube videos using Transformers."
 
43
  ten_seconds = 10 * 1000
44
  first_10_seconds = wav_to_cut[:ten_seconds]
45
  os.remove(new_file)
46
+ first_10_seconds.export("final_audio.wav", format="wav")
47
+ return "final_audio.wav"
48
 
49
  # Credits https://huggingface.co/spaces/jeffistyping/Youtube-Whisperer
50
  def populate_metadata(link):
 
62
 
63
  note_seq.sequence_proto_to_midi_file(est_ns, "./transcribed.mid")
64
 
65
+ # synth = note_seq.midi_synth.fluidsynth
66
+ # array_of_floats = synth(note_sequence, sample_rate=SAMPLE_RATE)
67
+ # int16_data = note_seq.audio_io.float_samples_to_int16(array_of_floats)
68
+ # piano_roll = create_image_from_note_sequence(note_sequence)
69
+
70
  return "./transcribed.mid"
71
 
72
  title = "Transcribe music from YouTube videos using Transformers."