juancopi81 commited on
Commit
47e2c4f
1 Parent(s): 196b7cd

Change to get only the first 10 secons of audio

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -242,7 +242,8 @@ def inference(audio):
242
  with open(audio, 'rb') as fd:
243
  contents = fd.read()
244
  audio = upload_audio(contents,sample_rate=16000)
245
-
 
246
  est_ns = inference_model(audio)
247
 
248
  note_seq.sequence_proto_to_midi_file(est_ns, './transcribed.mid')
 
242
  with open(audio, 'rb') as fd:
243
  contents = fd.read()
244
  audio = upload_audio(contents,sample_rate=16000)
245
+ # Get only first 10 seconds of audio with free Space hosting
246
+ audio = audio[:160000]
247
  est_ns = inference_model(audio)
248
 
249
  note_seq.sequence_proto_to_midi_file(est_ns, './transcribed.mid')