thanhtvt commited on
Commit
bcd8e2f
·
1 Parent(s): e9812a3

test tf.function greedy

Browse files
Files changed (2) hide show
  1. app.py +2 -19
  2. requirements.txt +1 -1
app.py CHANGED
@@ -19,7 +19,7 @@ def get_duration(filename: str) -> float:
19
  return librosa.get_duration(path=filename)
20
 
21
 
22
- def convert_to_wav(in_filename: str) -> str:
23
  out_filename = os.path.splitext(in_filename)[0] + ".wav"
24
  logging.info(f"Converting {in_filename} to {out_filename}")
25
  y, sr = librosa.load(in_filename, sr=16000)
@@ -27,24 +27,7 @@ def convert_to_wav(in_filename: str) -> str:
27
  return out_filename
28
 
29
 
30
- def convert_to_wav1(in_filename: str) -> str:
31
- """Convert the input audio file to a wave file"""
32
- out_filename = in_filename + ".wav"
33
- logging.info(f"Converting '{in_filename}' to '{out_filename}'")
34
- _ = os.system(f"ffmpeg -hide_banner -i '{in_filename}' -ar 16000 '{out_filename}'")
35
- _ = os.system(
36
- f"ffmpeg -hide_banner -loglevel error -i '{in_filename}' -ar 16000 '{out_filename}.flac'"
37
- )
38
-
39
- with open(out_filename + ".flac", "rb") as f:
40
- s = "\n" + out_filename + "\n"
41
- s += base64.b64encode(f.read()).decode()
42
- logging.info(s)
43
-
44
- return out_filename
45
-
46
-
47
- def convert_to_wav2(in_filename: str) -> str:
48
  """Convert the input audio file to a wave file"""
49
  out_filename = in_filename + ".wav"
50
  logging.info(f"Converting '{in_filename}' to '{out_filename}'")
 
19
  return librosa.get_duration(path=filename)
20
 
21
 
22
+ def convert_to_wav1(in_filename: str) -> str:
23
  out_filename = os.path.splitext(in_filename)[0] + ".wav"
24
  logging.info(f"Converting {in_filename} to {out_filename}")
25
  y, sr = librosa.load(in_filename, sr=16000)
 
27
  return out_filename
28
 
29
 
30
+ def convert_to_wav(in_filename: str) -> str:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  """Convert the input audio file to a wave file"""
32
  out_filename = in_filename + ".wav"
33
  logging.info(f"Converting '{in_filename}' to '{out_filename}'")
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- uetasr @ git+https://github.com/thanhtvt/uetasr@v0.2.0
2
  requests==2.28.2
 
1
+ uetasr @ git+https://github.com/thanhtvt/uetasr
2
  requests==2.28.2