Update app.py
Browse files
app.py
CHANGED
|
@@ -284,12 +284,15 @@ async def transcript_to_speech(transcript_text, voice, rate, pitch, speed_adjust
|
|
| 284 |
|
| 285 |
# Apply the low-pass filter here
|
| 286 |
cutoff_frequency = 3500 # 3.5 kHz (you can make this a user-configurable parameter later)
|
|
|
|
| 287 |
filtered_final_audio = apply_low_pass_filter(final_audio, cutoff_frequency, final_audio.frame_rate)
|
| 288 |
|
| 289 |
combined_audio_path = tempfile.mktemp(suffix=".mp3")
|
| 290 |
-
|
|
|
|
| 291 |
return combined_audio_path, None
|
| 292 |
|
|
|
|
| 293 |
@spaces.GPU
|
| 294 |
def tts_interface(transcript, voice, rate, pitch, speed_adjustment_factor):
|
| 295 |
audio, warning = asyncio.run(transcript_to_speech(transcript, voice, rate, pitch, speed_adjustment_factor))
|
|
|
|
| 284 |
|
| 285 |
# Apply the low-pass filter here
|
| 286 |
cutoff_frequency = 3500 # 3.5 kHz (you can make this a user-configurable parameter later)
|
| 287 |
+
print(f"Applying Low pass filter, cut off frequency: {cutoff_frequency}")
|
| 288 |
filtered_final_audio = apply_low_pass_filter(final_audio, cutoff_frequency, final_audio.frame_rate)
|
| 289 |
|
| 290 |
combined_audio_path = tempfile.mktemp(suffix=".mp3")
|
| 291 |
+
# Export the *filtered* audio here
|
| 292 |
+
filtered_final_audio.export(combined_audio_path, format="mp3")
|
| 293 |
return combined_audio_path, None
|
| 294 |
|
| 295 |
+
|
| 296 |
@spaces.GPU
|
| 297 |
def tts_interface(transcript, voice, rate, pitch, speed_adjustment_factor):
|
| 298 |
audio, warning = asyncio.run(transcript_to_speech(transcript, voice, rate, pitch, speed_adjustment_factor))
|