Wednesday, 27 April 2022

How to play sound or mp3 file in python?

#pip install pyaudio pydub

from pydub import AudioSegment
from pydub.playback import play

song = AudioSegment.from_mp3('speech_stranger.mp3')
play(song)

No comments:

Post a Comment