Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -321,15 +321,14 @@ async def concat_story_audio(story: StoryCreationDTO, base_output: str, final_pa
|
|
| 321 |
|
| 322 |
# --- Add SFX for location if available ---
|
| 323 |
if scene.location.path:
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
# print(f"SFX skipped for {scene.location.locationName}")
|
| 333 |
|
| 334 |
# --- Add background music if available ---
|
| 335 |
if scene.bgMusic and scene.bgMusic.musicPath:
|
|
|
|
| 321 |
|
| 322 |
# --- Add SFX for location if available ---
|
| 323 |
if scene.location.path:
|
| 324 |
+
sfx_file = await download_file_from_url(scene.location.path)
|
| 325 |
+
if sfx_file:
|
| 326 |
+
sfx_file_wav = ensure_wav(sfx_file)
|
| 327 |
+
sfx_audio = AudioSegment.from_wav(sfx_file_wav)
|
| 328 |
+
scene_audio = scene_audio.overlay(sfx_audio)
|
| 329 |
+
# os.remove(sfx_file)
|
| 330 |
+
else:
|
| 331 |
+
print(f"SFX skipped for {scene.location.locationName}")
|
|
|
|
| 332 |
|
| 333 |
# --- Add background music if available ---
|
| 334 |
if scene.bgMusic and scene.bgMusic.musicPath:
|