transiteration commited on
Commit
3934c3c
1 Parent(s): eed4c77

Update transcribe.py

Browse files
Files changed (1) hide show
  1. transcribe.py +0 -14
transcribe.py CHANGED
@@ -2,26 +2,12 @@ import os
2
  from pathlib import Path
3
  import nemo.collections.asr as nemo_asr
4
 
5
-
6
- # def converter(audio_file):
7
- # converted = audio_file.split(".")[0] + "converted_.wav"
8
- # cmd_str = f"ffmpeg -y -i {audio_file} -ac 1 -ar 16000 {converted}"
9
- # os.system(cmd_str)
10
- # # os.remove(audio_file)
11
- # return converted
12
-
13
-
14
-
15
  def transcribe(audio_file):
16
- # wav_file = converter(audio_file)
17
  try:
18
  text = model_kz.transcribe([audio_file])
19
  return text[0]
20
  except:
21
  return 'Try another file format.'
22
-
23
-
24
-
25
 
26
  language = "kz"
27
 
 
2
  from pathlib import Path
3
  import nemo.collections.asr as nemo_asr
4
 
 
 
 
 
 
 
 
 
 
 
5
  def transcribe(audio_file):
 
6
  try:
7
  text = model_kz.transcribe([audio_file])
8
  return text[0]
9
  except:
10
  return 'Try another file format.'
 
 
 
11
 
12
  language = "kz"
13