Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,10 +72,14 @@ class SentenceDto(BaseModel):
|
|
| 72 |
|
| 73 |
class SceneDto(BaseModel):
|
| 74 |
sceneId: str
|
| 75 |
-
|
| 76 |
sentences: List[SentenceDto]
|
| 77 |
bgMusic: BGMusicDto
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
class ChapterDto(BaseModel):
|
| 81 |
chapterId: str
|
|
@@ -225,7 +229,7 @@ async def concat_story_audio(story: StoryCreationDTO, base_output: str, final_pa
|
|
| 225 |
scene_audio += sentence_audio
|
| 226 |
|
| 227 |
# --- Add SFX for location if available ---
|
| 228 |
-
if scene.
|
| 229 |
sfx_file = await download_file_from_url(scene.locationName)
|
| 230 |
sfx_audio = AudioSegment.from_wav(sfx_file)
|
| 231 |
scene_audio = scene_audio.overlay(sfx_audio)
|
|
|
|
| 72 |
|
| 73 |
class SceneDto(BaseModel):
|
| 74 |
sceneId: str
|
| 75 |
+
location: LocationDto
|
| 76 |
sentences: List[SentenceDto]
|
| 77 |
bgMusic: BGMusicDto
|
| 78 |
|
| 79 |
+
class LocationDto(BaseModel):
|
| 80 |
+
locationName: str
|
| 81 |
+
path: str
|
| 82 |
+
|
| 83 |
|
| 84 |
class ChapterDto(BaseModel):
|
| 85 |
chapterId: str
|
|
|
|
| 229 |
scene_audio += sentence_audio
|
| 230 |
|
| 231 |
# --- Add SFX for location if available ---
|
| 232 |
+
if scene.location.path:
|
| 233 |
sfx_file = await download_file_from_url(scene.locationName)
|
| 234 |
sfx_audio = AudioSegment.from_wav(sfx_file)
|
| 235 |
scene_audio = scene_audio.overlay(sfx_audio)
|