How to play with pydub.
play.py
#! /usr/bin/python
#
# play.py
#
# Oct/06/2020
#
# ------------------------------------------------------------------
import sys
from pydub import AudioSegment
from pydub.playback import play
# ------------------------------------------------------------------
sys.stderr.write("***start***\n")
#
file_in = sys.argv[1]
audio_aa = AudioSegment.from_wav(file_in)
play(audio_aa)
#
sys.stderr.write("***End***\n")
# ------------------------------------------------------------------
Execution method
./play.py input.wav
Recommended Posts