Spaces:
Build error
Build error
LPhilp1943
commited on
Commit
•
6275fb1
1
Parent(s):
e9febae
Update app.py
Browse files
app.py
CHANGED
@@ -52,13 +52,13 @@ def text_to_speech(text):
|
|
52 |
# If input is already a path to synthesized speech, return it
|
53 |
return text
|
54 |
|
55 |
-
def speech_to_speech(
|
56 |
-
if
|
57 |
-
# If input is
|
58 |
-
transcription = speech_to_text(
|
59 |
else:
|
60 |
-
# If input is
|
61 |
-
transcription =
|
62 |
# Synthesize text to speech and resample to 16kHz
|
63 |
synthesized_speech_path = text_to_speech(transcription)
|
64 |
return synthesized_speech_path
|
|
|
52 |
# If input is already a path to synthesized speech, return it
|
53 |
return text
|
54 |
|
55 |
+
def speech_to_speech(input_audio, text_input=None):
|
56 |
+
if text_input is None:
|
57 |
+
# If no text input is provided, convert the input audio to text
|
58 |
+
transcription = speech_to_text(input_audio)
|
59 |
else:
|
60 |
+
# If text input is provided, use it directly
|
61 |
+
transcription = text_input
|
62 |
# Synthesize text to speech and resample to 16kHz
|
63 |
synthesized_speech_path = text_to_speech(transcription)
|
64 |
return synthesized_speech_path
|