play sound file python code example
Example 1: play music from python
from playsound import playsound
playsound('audio.mp3')
Example 2: Play sound in python
import winsound
winsound.PlaySound('sound.wav', winsound.SND_FILENAME)
Example 3: play sound directly with pytts
import pyttsx
engine = pyttsx.init()
engine.say('Good morning.')
engine.runAndWait()