You can try out pya (https://github.com/interactive-sonification/pya) or install through pip. Playing mp3 is not as straight forward, as it needs ffmpeg in this case. Before you install pya, first install portaudio and ffmpeg:
brew install portaudio
brew install ffmpeg
then
pip install pya
pya split audio editing and playback in 2 classes: Asig which holds your array, mysound = Asig(filepath). To play it, you need to activate a server Aserver, and call Asig.play() with a specific server, example below:
from pya import Asig, Aserver
s = Aserver()
s.boot()
mysong = Asig(filepath)
mysong.play(server=s)
You can do basic processing to it like make it louder quieter, or panning:
mysong.gain(db=-3).pan2(-0.5).play(server=s) # panning between -1. (left) to 1. (right)
You signal array is a numpy array at mysong.sig
, along with other meta such as mysong.sr
, mysong.samples
, mysong.channels
.