Before getting my new HifiBerry Amp+ card I have used Pygame to play mp3 files in Python.
That does not work with Amp+.
Does anyone know a package on PyPI that can play mp3 files that works with Amp+?
Brgds,
Alex
Before getting my new HifiBerry Amp+ card I have used Pygame to play mp3 files in Python.
That does not work with Amp+.
Does anyone know a package on PyPI that can play mp3 files that works with Amp+?
Brgds,
Alex
Hi Alex,
there are already some projects here using Python. I don't see a reason why Pygame should not work. Check the exact error message. It can be a permissions problem.
Best regards
Daniel
Hi Daniel.
I managed to find a solution!
I added the line with pygame.mixer.pre_init! The code looks like this.
import pygame
while True:
pygame.mixer.pre_init(frequency=44100, size=-16, channels=2, buffer=4096)
pygame.mixer.init()
pygame.mixer.music.load("a.mp3")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy()==True:
continue