Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -176,13 +176,13 @@ def process_text_to_audio(text, translatefrom="English", translateto="English"):
|
|
| 176 |
# Assuming the audio file is stored in a publicly accessible location
|
| 177 |
# Append the base URL to the audio file path
|
| 178 |
base_url = "https://multitransformer-ayatonic.hf.space/"
|
| 179 |
-
audio_url = base_url
|
| 180 |
|
| 181 |
return audio_url
|
| 182 |
except Exception as e:
|
| 183 |
print(f"Error processing text to audio: {e}")
|
| 184 |
return None
|
| 185 |
-
|
| 186 |
def save_audio_data_to_file(audio_data, directory="audio_files", filename="output_audio.wav"):
|
| 187 |
"""
|
| 188 |
Save audio data to a file and return the file path.
|
|
|
|
| 176 |
# Assuming the audio file is stored in a publicly accessible location
|
| 177 |
# Append the base URL to the audio file path
|
| 178 |
base_url = "https://multitransformer-ayatonic.hf.space/"
|
| 179 |
+
audio_url = os.path.join(base_url, file_name) # Use os.path.join to handle any path issues
|
| 180 |
|
| 181 |
return audio_url
|
| 182 |
except Exception as e:
|
| 183 |
print(f"Error processing text to audio: {e}")
|
| 184 |
return None
|
| 185 |
+
|
| 186 |
def save_audio_data_to_file(audio_data, directory="audio_files", filename="output_audio.wav"):
|
| 187 |
"""
|
| 188 |
Save audio data to a file and return the file path.
|