Small, multitasking audio player

Hi there,

I am working on a project, that requires multiple audio files to be played at the same time. As in, I need a small audio player, that can be controlled by a micro controller in the Arduino Nano form factor, which is also capable of (for example) playing "audiofile1" constantly in a seamless loop, and when a button is pressed, play "audiofile2" over top of "audiofile1", so you still hear "audiofile1" as the base sound and "audiofile2" as an additional sound.
I tried the DFPlayer Mini, which is completely useless for that application.
Any suggestions, which device might work for me?

https://www.pjrc.com/teensy/td_libs_Audio.html

You might be better-off with a Raspberry Pi.

1 Like

Is there a Raspberry PI the size of an Arduino Nano? Because I need something that is that small. I don't have much room to work with...

Raspberry Pi Zero is the smallest and is only a little bigger than Nano.

No, it would be useful.
The task is simple - to playing a two songs you need a two DFPlayers.

2 Likes

The alternative is this, but it is expensive:-
https://eu.mouser.com/c/?q=474-WIG-13660

Hi,

Could you elaborate on that please? Depending on what kinds of audio you want playing simultaneously, and for what purpose, I think the DFR module might be a good choice. Just record two pieces in the same MP3.

Several apps can merge tracks, such as GoldWave, Audacity, etc. Pressing Button 1 would play just your music track, announcement, or whatever, from 0001.mp3, and Button 2 would switch to .0002.mp3 to add your crashing ocean surf, fire alarm, etc.

As usual, the devil is in the details.

Yeah, that does sound like a good and simple solution. But this approach would require the DFR module to be able to play audio files basically instantly. The DFPlayer Mini I currently have suffers from very noticable loading times. It is absolutely incapable of playing two audio files back to back without a second long pause in between, which ruins the effect.

Fair point, there is a delay, although until I check it I’m not sure how brief it could be. Would a fast fade down and up in the adjacent tracks be acceptable?

I’m curious. Could you give us some background about the intended purpose and maybe examples of the two simultaneous sounds?

If a fade work around wouldn’t suit, then @b707s suggestion would be a simple and inexpensive solution, albeit arguably not as satisfying!

Is this for MP3 files? These do take a time to start the decoding process.

For quicker sounds use another format, preferable an uncompressed one. Like a .WAV file.

Of course :slight_smile:

Do you know FX lightsabers? These Star Wars lightsabers, that light up, make sounds and react to swings an clashes? I recently got a decent one and was pretty intrigued by it. And I wanted to see, if I could recreate the functionality of these swords using my pretty fresh and limited knowledge of Arduino stuff. I already have a an LED strip fully animated with activation and deactivation sequences, blade flashes for impacts and I have an accelerometer hooked up and working for detecting light and fast swings. But the audio part is giving me trouble.

To be precise:
I need a way to play the constant humming sound of a lightsaber while the blade is turned on, play the activation and deactivation sounds when turning the blade on and off, and play swing and clash sounds when the blade is swung or impacts something over top of the humming sound.

Really? I thought using an uncompressed file would lead to longer delays due to the larger file size. But what you are saying sounds reasonable. I will give that a try! Might fix some of my issues

DFPlayer Mini is a stand-alone MP3 player. All you need to do is ground the "Next" or "Previous" pin and another song plays. Just wire a button. No need for a microcontroller.

Basically, it does. If you store long gaps in the audio file, that's not the fault of DFPlayer Mini.

All audio files should be what I call "topped and tailed".
That is removing the gaps between the start of the file and the start of the sound (topped) and removing the silence at the end of the file (tailed).

You can do this with the free to use multiple platform application Audacity.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.