I need to be able to play up to 8 mp3 files at the same time. Is this possible with the raspberry pi 3b+? They need to be started in python code.
Based on my answer here:
The test is done on a Pi Zero with a recent Raspbian, Python 3.6,
vlc (along with approx. 150 other packages), and it's Python-bindings. It's using a USB soundcard and
Playing from Python worked straight forward:
import vlc instance = vlc.Instance('--aout=alsa') p = instance.media_player_new() m = instance.media_new('something.mp3') p.set_media(m) p.play() p.pause() vlc.libvlc_audio_set_volume(p, volume) # volume 0..100
I was able to run four independent mp3's from a single Python process with a CPU load of about 87%. Starting a fifth player resulted in this error:
alsa audio output error: cannot estimate delay: Broken pipe
Given the more powerful CPU of the Pi 3B+ and its four cores I dare say it'll work. Use
multiprocessing though to allow for the distribution of the load to more than one core.