@@ -701,7 +701,18 @@ async def _func(self, message: list[str], player: Player) -> int:
701701 speed = modifiers ["Speed" ]
702702 pitch = modifiers ["Pitch" ]
703703
704- return audio_clip .Play (volume = volume , speed = speed , pitch = pitch )
704+ start : int | None = None
705+ duration : int | None = None
706+
707+ if "Start" in modifiers :
708+ start = int (modifiers ["Start" ])
709+ start = start if start >= 0 else None
710+ if "End" in modifiers :
711+ end = int (modifiers ["End" ])
712+ if end > 0 and start is not None and end > start :
713+ duration = end - start
714+
715+ return audio_clip .Play (seconds = start , duration = duration , volume = volume , speed = speed , pitch = pitch )
705716
706717 def get_sound_path (self , player : Player , voice_trigger : str , trigger_number : str ) -> str | None :
707718 level = player .admin .level
@@ -1189,7 +1200,7 @@ async def Say(self, player: Player, message: str) -> int:
11891200 os .unlink (temp_file .name )
11901201 return 1
11911202
1192- if audio_clip .Play (None , "-af" , "volume=10dB" ):
1203+ if audio_clip .Play (None , None , "-af" , "volume=10dB" ):
11931204 audio_clip .audio_player .AddCallback ("Stop" , lambda : os .unlink (temp_file .name ))
11941205 return 0
11951206
0 commit comments