cdleong commited on
Commit
55c2b20
1 Parent(s): 4b18b93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -3,7 +3,7 @@ import langcodes
3
  from allosaurus.app import read_recognizer
4
 
5
 
6
- def get_bytes_in_wav_format(uploaded_file):
7
  st.write(dir(uploaded_file))
8
  st.write(type(uploaded_file))
9
  if ".wav" in uploaded_file:
@@ -40,13 +40,15 @@ if __name__ == "__main__":
40
 
41
 
42
  if uploaded_file is not None:
43
- audio_bytes = get_bytes_in_wav_format(uploaded_file)
44
 
45
 
46
  # audio_bytes = audio_file.read()
47
  st.audio(uploaded_file, format='audio/wav')
48
 
49
- result = model.recognize(audio_bytes, langcode)
 
 
50
  st.write(result)
51
 
52
 
 
3
  from allosaurus.app import read_recognizer
4
 
5
 
6
+ def get_path_to_wav_format(uploaded_file):
7
  st.write(dir(uploaded_file))
8
  st.write(type(uploaded_file))
9
  if ".wav" in uploaded_file:
 
40
 
41
 
42
  if uploaded_file is not None:
43
+
44
 
45
 
46
  # audio_bytes = audio_file.read()
47
  st.audio(uploaded_file, format='audio/wav')
48
 
49
+ wav_file = get_path_to_wav_format(uploaded_file)
50
+
51
+ result = model.recognize(uploaded_file, langcode)
52
  st.write(result)
53
 
54