Maker Pro
Maker Pro

I'd like to know how put a digital sound bite on a component

rickus

Jan 3, 2012
3
Joined
Jan 3, 2012
Messages
3
I'm not a student doing homework; however, I am a newbie to electronics and have learned many of the basics self-taught (I've gotten pretty good at soldering components onto circuit boards, too). Simply put, what I would specifically like to know is how to put a digital sound (for example, a doorbell sound from a .WAV file) onto an electronic component; then, push a button and play it through a speaker. A good example would be the sounds that come out of the scary decorations you'd see at those Spirit shops during the Halloween season. I've dissected some of those devices to find a small circuit board that has what appears to be some kind of chip beneath a dab of black glue (see photo). I assume this is where the sound is stored. Anyway, I'm inspired to create my own sounds in such a manner. If someone could explain the concept to me and/or direct me to a DIY project page or file, that would be helpful. Thanks in advance!
 

Attachments

  • IMG_1706.JPG
    IMG_1706.JPG
    326.9 KB · Views: 7

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
A good example would be the sounds that come out of the scary decorations you'd see at those Spirit shops during the Halloween season. I've dissected some of those devices to find a small circuit board that has what appears to be some kind of chip beneath a dab of black glue (see photo). I assume this is where the sound is stored. Anyway, I'm inspired to create my own sounds in such a manner. If someone could explain the concept to me and/or direct me to a DIY project page or file, that would be helpful. Thanks in advance!


google sound recorder
You can buy them to make up your own birthday greeting cards etc
 

Bluejets

Oct 5, 2014
6,901
Joined
Oct 5, 2014
Messages
6,901
how to put a digital sound (for example, a doorbell sound from a .WAV file) onto an electronic component; then, push a button and play it through a speaker.

Can be done via an SD card, an adaptor and an Arduino along with suitable power supplies and amplifiers etc. for playback and some general uC know-how..

In this instance the SD card being your wav storage device.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
Can be done via an SD card, an adaptor and an Arduino along with suitable power supplies and amplifiers etc. for playback and some general uC know-how..

In this instance the SD card being your wav storage device.


yes but is getting quite bulky ;)
 

pgib8

Jul 26, 2015
107
Joined
Jul 26, 2015
Messages
107
You have a digital to analog converter in your microcontroller and you have a long list of output levels (samples) that are like notes and represent your sound. This long list could very well be stored in internal flash. At discrete time steps the microcontroller loads the next sample. The faster you can move through the samples, the higher of a frequency you can reproduce with the sound but the longer your "file" becomes. You'll need to figure out the number of bits your DAC can use, and how fast you can/want to make the sampling rate. You'll need to grab the original sound, which is a similar list of values (should be pretty easy from .WAV) and then you need to scale it.
The main difference will be that whatever comes out of your microcontroller will look like a staircase at first, even if you do the full number of bits and sampling rate. So the last part would be a low-pass filter. It will need to be at least 1/2 the frequency of your sampling rate but probably a little bit lower. If you wanted to produce sounds up to 20kHz, then your low-pass should start cutting off right after that, for example 23kHz and then your sampling rate should probably be around 50kHz (I'm adding in some margin, it never hurts). Your file will get quite large and may not fit inside the internal flash, so you'll likely need to cut back on the sound quality. That's why those scary decorations sound like crap :)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
There are less expensive sound modules available in the line of this one. You simply load the sound fie onto an SD card and the module plays the sound when a button is pressed. Output power is sufficient for a small speaker. Use an additional amplifier for a larger speaker.
 
Last edited:

bertus

Moderator
Nov 8, 2019
3,304
Joined
Nov 8, 2019
Messages
3,304
Hello,

@Harald Kapp , Sorry, I tried the link, but it does not work.
The link seems to be a command to create a MP4 file, using ffmpeg.

Bertus
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
@bertus : Thanks for the tip, I seem to have had a wrong link in my clipboard. Link is now corrected.
 
Top