cdleong commited on
Commit
fa6f9dd
·
1 Parent(s): 5d08fb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -8,7 +8,10 @@ def get_path_to_wav_format(uploaded_file):
8
  st.write(dir(uploaded_file))
9
  st.write(type(uploaded_file))
10
  st.write(uploaded_file)
 
 
11
  if ".wav" in uploaded_file.name:
 
12
  return Path(uploaded_file.name)
13
  # TODO: .mp3 conversion
14
 
@@ -45,13 +48,11 @@ if __name__ == "__main__":
45
 
46
 
47
 
48
- # audio_bytes = audio_file.read()
49
  st.audio(uploaded_file, format='audio/wav')
50
 
51
- # wav_file = get_path_to_wav_format(uploaded_file)
52
- with open(uploaded_file, 'rb') as wav_file:
53
- # st.write(wav_file)
54
- result = model.recognize(wav_file, langcode)
55
- st.write(result)
56
 
57
 
 
8
  st.write(dir(uploaded_file))
9
  st.write(type(uploaded_file))
10
  st.write(uploaded_file)
11
+
12
+
13
  if ".wav" in uploaded_file.name:
14
+ actual_file = uploaded_file.write(uploaded_file.name)
15
  return Path(uploaded_file.name)
16
  # TODO: .mp3 conversion
17
 
 
48
 
49
 
50
 
 
51
  st.audio(uploaded_file, format='audio/wav')
52
 
53
+ wav_file = get_path_to_wav_format(uploaded_file)
54
+ st.write(wav_file)
55
+ result = model.recognize(wav_file, langcode)
56
+ st.write(result)
 
57
 
58