made dec talk work again, fixed so pitch and tempo can work with random chosen, example playb, train

This commit is contained in:
2024-08-05 21:37:42 +02:00
parent dc8b4badd0
commit e29eb32a91
3 changed files with 8 additions and 6 deletions
@@ -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: