groove startup when os.system('smth.mp3'), python

23 Views Asked by At

can I play sound without opening groove anytime with python like os.system('start .mp3') or just only filename, it always open groove music, how can I just play a sound?

I tried playsound but it dont work properly, always crash.

    @staticmethod
    def TextToSpeech(text):
        print('AI -->', text)
        speaker = gTTS(text=text, lang='en', slow=False)
        speaker.save('response.mp3')
        os.system('start response.mp3')
        os.remove('response.mp3')

this is my piece of code, where I tried to play a sound

0

There are 0 best solutions below