insanecoder69 commited on
Commit
7427d02
·
verified ·
1 Parent(s): 25b096e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -22,13 +22,14 @@ os.makedirs(os.path.dirname(OUTPUT_MP4_PATH), exist_ok=True)
22
 
23
  def convert_audio_to_wav(input_audio):
24
  # Use a temporary file to save the .wav output
25
- temp_wav = tempfile.NamedTemporaryFile(delete=False, suffix=".wav")
26
- temp_wav_path = temp_wav.name
27
 
28
  # Convert the input audio to .wav format
29
  audio = AudioSegment.from_file(input_audio)
30
- audio.export(temp_wav_path, format="wav")
31
- return temp_wav_path
 
32
 
33
 
34
  def run_demo_and_get_video(input_audio):
@@ -41,7 +42,7 @@ def run_demo_and_get_video(input_audio):
41
  "python", DEMO_SCRIPT_PATH,
42
  "--config_file", CONFIG_FILE,
43
  "--infer",
44
- "--audio_file", wav_path,
45
  "--body_model_name", "s2g_LS3DCG",
46
  "--body_model_path", BODY_MODEL_PATH,
47
  "--id", "0"
 
22
 
23
  def convert_audio_to_wav(input_audio):
24
  # Use a temporary file to save the .wav output
25
+ # temp_wav = tempfile.NamedTemporaryFile(delete=False, suffix=".wav")
26
+ # temp_wav_path = temp_wav.name
27
 
28
  # Convert the input audio to .wav format
29
  audio = AudioSegment.from_file(input_audio)
30
+ audio.export("test.wav", format="wav")
31
+
32
+ return True
33
 
34
 
35
  def run_demo_and_get_video(input_audio):
 
42
  "python", DEMO_SCRIPT_PATH,
43
  "--config_file", CONFIG_FILE,
44
  "--infer",
45
+ "--audio_file", "test.wav",
46
  "--body_model_name", "s2g_LS3DCG",
47
  "--body_model_path", BODY_MODEL_PATH,
48
  "--id", "0"