diff --git a/torchlight_changes_unloze/torchlight3/Torchlight/AudioManager.py b/torchlight_changes_unloze/torchlight3/Torchlight/AudioManager.py index 264f007f..71c6d4f5 100755 --- a/torchlight_changes_unloze/torchlight3/Torchlight/AudioManager.py +++ b/torchlight_changes_unloze/torchlight3/Torchlight/AudioManager.py @@ -303,8 +303,8 @@ class AudioClip(): def __del__(self): self.Logger.info("~AudioClip()") - def Play(self, seconds = None, rubberband = None, *args): - return self.AudioPlayer.PlayURI(self.URI, seconds, rubberband = rubberband, *args) + def Play(self, seconds = None, rubberband = None, dec_params = None, *args): + return self.AudioPlayer.PlayURI(self.URI, position = seconds, rubberband = rubberband, dec_params = dec_params, *args) def Stop(self): return self.AudioPlayer.Stop() diff --git a/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py b/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py index 1c95b013..91ed7b6a 100755 --- a/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py +++ b/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py @@ -561,8 +561,7 @@ class VoiceCommands(BaseCommand): if isinstance(Sounds, list): if Num and Num > 0 and Num <= len(Sounds): Sound = Sounds[Num - 1] - - elif message[1]: + elif message[1] and message[1][0].isdigit(): #first character is digit, so its not pitch or tempo searching = message[1].startswith('?') search = message[1][1:] if searching else message[1].split(" ")[0] Sound = None @@ -752,7 +751,7 @@ class DECTalk(BaseCommand): os.unlink(TempFile.name) return 1 - if AudioClip.Play(None, "-af", "volume=10dB"): + if AudioClip.Play(dec_params = ["-af", "volume=10dB"]): AudioClip.AudioPlayer.AddCallback("Stop", lambda: os.unlink(TempFile.name)) return 0 else: diff --git a/torchlight_changes_unloze/torchlight3/Torchlight/FFmpegAudioPlayer.py b/torchlight_changes_unloze/torchlight3/Torchlight/FFmpegAudioPlayer.py index 1d64bbee..b0ff290b 100755 --- a/torchlight_changes_unloze/torchlight3/Torchlight/FFmpegAudioPlayer.py +++ b/torchlight_changes_unloze/torchlight3/Torchlight/FFmpegAudioPlayer.py @@ -57,7 +57,7 @@ class FFmpegAudioPlayer(): self.Master.Logger.debug("~FFmpegAudioPlayer()") self.Stop() - def PlayURI(self, uri, position, rubberband = None, *args): + def PlayURI(self, uri, position, rubberband = None, dec_params = None, *args): if position: PosStr = str(datetime.timedelta(seconds = position)) Command = ["/usr/bin/ffmpeg", "-ss", PosStr, "-i", uri, "-acodec", "pcm_s16le", "-ac", "1", "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn", *args] @@ -65,6 +65,9 @@ class FFmpegAudioPlayer(): Command = ["/usr/bin/ffmpeg", "-i", uri, "-acodec", "pcm_s16le", "-ac", "1", "-ar", str(int(self.SampleRate)), "-f", "s16le", "-vn", *args] self.Playing = True + if dec_params: + Command += dec_params + if rubberband: Command += ["-filter:a"] rubberCommand = ""