faiimea commited on
Commit
9494706
·
verified ·
1 Parent(s): 9f16fe1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
5
  def convert_6ch_wav_to_stereo(input_file_path, output_file_path):
6
  sound = AudioSegment.from_file(input_file_path, format="wav")
7
  if sound.channels != 6:
8
- raise ValueError("The input file does not have 6 channels.")
9
  front_left = sound.split_to_mono()[0]
10
  front_right = sound.split_to_mono()[1]
11
  center = sound.split_to_mono()[2]
@@ -21,7 +21,7 @@ def convert_6ch_wav_to_stereo(input_file_path, output_file_path):
21
 
22
 
23
  def judge_command(file_path):
24
- whisper_model = whisper.load_model("large", device="cpu")
25
  out_path='./out.wav'
26
  convert_6ch_wav_to_stereo(file_path,out_path)
27
  result = whisper_model.transcribe(out_path,language="en")
 
5
  def convert_6ch_wav_to_stereo(input_file_path, output_file_path):
6
  sound = AudioSegment.from_file(input_file_path, format="wav")
7
  if sound.channels != 6:
8
+ sound.export(output_file_path, format="wav")
9
  front_left = sound.split_to_mono()[0]
10
  front_right = sound.split_to_mono()[1]
11
  center = sound.split_to_mono()[2]
 
21
 
22
 
23
  def judge_command(file_path):
24
+ whisper_model = whisper.load_model("medium", device="cpu")
25
  out_path='./out.wav'
26
  convert_6ch_wav_to_stereo(file_path,out_path)
27
  result = whisper_model.transcribe(out_path,language="en")