What component can play an audio message?

I have a device that will be put on the user's leg. One of it's features is to detect objects in front and to the side, using two ultrasonic distance sensors.

When the sensors detect an object within their range, I'd like an audio message to play, saying "Object in front" or "Object on left" etc.

Right now I'm using vibration motors to buzz and let the user know about the object. What can I use to play an audio message?

MP3 player module, play back tracks from an SD card. There are plenty available, such as

What can I use to play an audio message?

You can either use a small 8Ohm-speaker and a resistor or capacitor, or a piezo speaker.

Short audio messages in low-quality audio can be included in your sketch within a PROGMEM data array and played directly from program flash memory to speaker. Longer sounds can be played from a SD card.

An UNO provides 32 KB of flash memory, let's assume the program is 4 KB in size, then you have 28KB left for sound data.

"speech quality" sound data could be included in 8-bit PCM 4000Hz audio format, this would use 4KB of program size for each second of audo, or 28 KB audio data for seven seconds.

Do you already have audio recordings of the sound to play, available in any audio file format?

I can share experience with 1 option:
I bought a DF player mini to play around with sounds along the same lines as what you are looking to do. I used this free website for sound files. There are other sites like this as well. Google: Text to speech.
Another thing you can do for audio sounds/files if you want to add a little more "spice" is use a free program called Audacity. If you have a sound clip from a movie or something that says exactly what you want, you can record a sound clip from youtube. Or just use it to record and edit from a mic.

Datasheet for DF player Mini says it can drive a small speaker less than 3w, or has line outs if going to an amplifier. Get others advice here. I am not qualified on speaker power ratings.

You can store about 3.5 seconds of audio in an Arduino, so if you keep it short like "left" and "right" you don't need anything else except perhaps an amplifier. Here is what I did:-

Arduino Uno saying Yes & No without extra hardware - YouTube

Are you, or have you ever been a DJ? :smiley: You got the chopping and scratching down.

DJ Scratching Skratch Bastid - David Bowie Tribute "Let's Dance" routine - YouTube

Are you, or have you ever been a DJ?

Well yes but way back in the 60s before that sort of thing was invented. :slight_smile:

You can use this site to generate speech files too… I find very usefull to my projects.

Yes but that produces MP3 files. Not something that is of much use in an Arduino Project, and it is not free.

If it's only speech then this encoder converts mp3 to 1 bit stream. Although Roman Black hasn't update his site in years it's still an interesting site nevertheless. Although meant for Pic it will work

1 bit encoder