I've been trying for hours - using parts of the code found here:
https://learn.adafruit.com/walkmp3rson- ... alkmp3rson
I set the buffer_size=32768 - which finally let the mp3 files play:
Code: Select all
mixer = audiomixer.Mixer(voice_count=2, sample_rate=44100, channel_count=1,bits_per_sample=16, samples_signed=True, buffer_size=32768)
If I use MP3Decoder on it's own, like this:
Code: Select all
a = AudioOut(board.A0)
mymp3 = MP3Decoder(open("sound.mp3", "rb"))
a.play(mymp3)
As soon as I try and use audiomixer, the sound becomes crackly...
Code: Select all
a = AudioOut(board.A0)
mixer = audiomixer.Mixer(voice_count=2, sample_rate=44100, channel_count=1,bits_per_sample=16, samples_signed=True, buffer_size=32768)
ffile1 = MP3Decoder(open("sound.mp3", "rb"))
ffile2 = MP3Decoder(open("sound2.mp3", "rb"))
a.play(mixer)
mixer.voice[0].level = 0.5
mixer.voice[1].level = 0.5
mixer.voice[0].play(ffile1, loop=True)
mixer.voice[1].play(ffile2, loop=True)
Code: Select all
from audiopwmio import PWMAudioOut as AudioOut # For ItsyBitsy
from audioio import AudioOut # For Feather?
Thanks for help!