Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -319,8 +319,9 @@ async def concat_story_audio(story: StoryCreationDTO, base_output: str, final_pa
|
|
| 319 |
sentence_audio = AudioSegment.from_wav(sentence_path)
|
| 320 |
scene_audio += sentence_audio
|
| 321 |
|
| 322 |
-
|
| 323 |
-
|
|
|
|
| 324 |
# sfx_file = await download_file_from_url(scene.location.path)
|
| 325 |
# if sfx_file:
|
| 326 |
# sfx_file_wav = ensure_wav(sfx_file)
|
|
@@ -335,7 +336,7 @@ async def concat_story_audio(story: StoryCreationDTO, base_output: str, final_pa
|
|
| 335 |
bg_url = scene.bgMusic.musicPath
|
| 336 |
bg_file = await download_file_from_url(bg_url)
|
| 337 |
bg_file_wav = ensure_wav(bg_file)
|
| 338 |
-
bg_audio = AudioSegment.
|
| 339 |
|
| 340 |
# Adjust volume
|
| 341 |
bg_audio = bg_audio - (1 - scene.bgMusic.volume) * 30 # approximate
|
|
|
|
| 319 |
sentence_audio = AudioSegment.from_wav(sentence_path)
|
| 320 |
scene_audio += sentence_audio
|
| 321 |
|
| 322 |
+
# --- Add SFX for location if available ---
|
| 323 |
+
if scene.location.path:
|
| 324 |
+
continue
|
| 325 |
# sfx_file = await download_file_from_url(scene.location.path)
|
| 326 |
# if sfx_file:
|
| 327 |
# sfx_file_wav = ensure_wav(sfx_file)
|
|
|
|
| 336 |
bg_url = scene.bgMusic.musicPath
|
| 337 |
bg_file = await download_file_from_url(bg_url)
|
| 338 |
bg_file_wav = ensure_wav(bg_file)
|
| 339 |
+
bg_audio = AudioSegment.from_file(bg_file_wav)
|
| 340 |
|
| 341 |
# Adjust volume
|
| 342 |
bg_audio = bg_audio - (1 - scene.bgMusic.volume) * 30 # approximate
|