Hi,
For a pédagogical musical projet, I would need to create a system with several 'layers of sound' meaning one sound file for exemple melody, one for harmony and one for explaiations and I would to be abbe to mute each of those track when I wants duriing playing in the same time.
Do you have any idea of which sound format I should use ?
Do I need to use a external soundmodule or does Micropython could read up to 5 tracks simulaneously ?
I would need also a 3.5mm jack for headphone.
The duration of those simultaneous tracks could be up to 20 min.
Best, and Thanks for your experience sharing
Reading multiples waves files in the same time
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Reading multiples waves files in the same time
I think this is beyond the scope of microcontroller hardware for a variety of reasons.
I would consider using something like a Raspberry Pi hosting a full version of Linux. I'd ask for advice in a suitable forum: Linux has a variety of audio applications which can probably do what you are after.
I would consider using something like a Raspberry Pi hosting a full version of Linux. I'd ask for advice in a suitable forum: Linux has a variety of audio applications which can probably do what you are after.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Reading multiples waves files in the same time
To expand on pythoncoder's answer, I think the real hard part here would be to read "on the fly" or to store in memory 20 mn of non-repeating music, at a reasonably good sounding bitrate. If a lot of the audio is repeated (e.g. mixing single-tone piano notes with short percussion clips and one or more cyclic loops), as long as you can hold the data in memory you can play it, using a DAC or an I2S output. In my experience a TinyPICO, offering SPIRAM and I2S, works well (maybe throw in ulab for efficient mixing of audio tracks).
But, again, you'll probably never fit 20 mn of multi-track hi-fi audio in memory.
But, again, you'll probably never fit 20 mn of multi-track hi-fi audio in memory.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Reading multiples waves files in the same time
My comment was based on experience developing this library which can play MP3 and FLAC files via an external decoder chip. Handling a single audio stream from a file on an SD card was near the limit of what could be achieved, even with the number crunching of decoding the stream offloaded to external hardware.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.