jaekookang commited on
Commit
0635e9e
1 Parent(s): e016491

change soundfile to librosa

Browse files
Files changed (2) hide show
  1. gradio_asr_en_libri100.py +4 -2
  2. requirements.txt +0 -1
gradio_asr_en_libri100.py CHANGED
@@ -12,7 +12,8 @@
12
  import os
13
  from glob import glob
14
  from loguru import logger
15
- import soundfile as sf
 
16
  import gradio as gr
17
 
18
  from espnet_model_zoo.downloader import ModelDownloader
@@ -51,7 +52,8 @@ logger.info('model loaded')
51
 
52
  def predict(wav_file):
53
  logger.info('wav file loaded')
54
- speech, rate = sf.read(wav_file)
 
55
  nbests = model(speech)
56
  text, *_ = nbests[0]
57
  logger.info('predicted')
 
12
  import os
13
  from glob import glob
14
  from loguru import logger
15
+ # import soundfile as sf
16
+ import librosa
17
  import gradio as gr
18
 
19
  from espnet_model_zoo.downloader import ModelDownloader
 
52
 
53
  def predict(wav_file):
54
  logger.info('wav file loaded')
55
+ # speech, rate = sf.read(wav_file)
56
+ speech, rate = librosa.load(wav_file, sr=16000)
57
  nbests = model(speech)
58
  text, *_ = nbests[0]
59
  logger.info('predicted')
requirements.txt CHANGED
@@ -1,5 +1,4 @@
1
  espnet_model_zoo==0.1.7
2
  gradio==2.7.5.2
3
  loguru==0.6.0
4
- soundfile
5
  librosa
 
1
  espnet_model_zoo==0.1.7
2
  gradio==2.7.5.2
3
  loguru==0.6.0
 
4
  librosa