badalsahani commited on
Commit
36b38f8
·
1 Parent(s): 2ca9d2a

Update app/main.py

Browse files
Files changed (1) hide show
  1. app/main.py +3 -2
app/main.py CHANGED
@@ -32,11 +32,12 @@ async def main(file: UploadFile):
32
  async def url(url: str):
33
  with TemporaryDirectory(dir=".") as tempdir:
34
  text = ""
 
35
  audio_file = f'{tempdir}/audio.wav'
36
  srt_file = f'{tempdir}/audio.srt'
37
  ssml_file = f'{tempdir}/ssml.txt'
38
- download_audio(url, input)
39
- m4a_to_wav(input, audio_file)
40
  command = ["las", "gen", "-s", audio_file]
41
  subprocess.run(command)
42
  sub_to_ssml(srt_file, ssml_file, "hi-IN", "hi-IN-SwaraNeural", "Female", "en", "hi")
 
32
  async def url(url: str):
33
  with TemporaryDirectory(dir=".") as tempdir:
34
  text = ""
35
+ input_audio = f'{tempdir}/audio.m4a'
36
  audio_file = f'{tempdir}/audio.wav'
37
  srt_file = f'{tempdir}/audio.srt'
38
  ssml_file = f'{tempdir}/ssml.txt'
39
+ download_audio(url, input_audio)
40
+ m4a_to_wav(input_audio, audio_file)
41
  command = ["las", "gen", "-s", audio_file]
42
  subprocess.run(command)
43
  sub_to_ssml(srt_file, ssml_file, "hi-IN", "hi-IN-SwaraNeural", "Female", "en", "hi")