Skip to content

Commit c939c06

Browse files
committed
Fix some bugs
1 parent 04b535d commit c939c06

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/sdialog/audio/pipeline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ def to_audio(
259259
# Place the speakers around the furnitures in the room
260260
for _role, _kwargs in speaker_positions.items():
261261

262+
if _role in room.speakers_positions:
263+
continue
264+
262265
room.place_speaker_around_furniture(
263266
speaker_name=_role,
264267
furniture_name=_kwargs["furniture_name"],

src/sdialog/audio/room.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,11 @@ def model_post_init(self, __context: Any) -> None:
14491449
Post init function to set the microphone position 3D.
14501450
"""
14511451

1452+
if len(self.speakers_positions) > 0:
1453+
for _role, _position in self.speakers_positions.items():
1454+
if _role not in [Role.SPEAKER_1, Role.SPEAKER_2]:
1455+
raise ValueError(f"Speaker name '{_role}' is not valid, the speaker wasn't placed")
1456+
14521457
# if the user override the center of the room, add it to the furnitures
14531458
if "center" not in self.furnitures:
14541459
self.furnitures["center"] = Furniture(

0 commit comments

Comments
 (0)