EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: unknownparticle on September 11, 2022, 10:14:42 pm

Title: pre-recorded sound chip?
Post by: unknownparticle on September 11, 2022, 10:14:42 pm
What are the chips in retail products that play a pre-recorded sound, like a music clip, sound effect etc when a lid is opened or a button pressed etc, called?
Title: Re: pre-recorded sound chip?
Post by: Whales on September 11, 2022, 10:22:09 pm
I've seen a few variants of this.

Super old or cheap: dedicated chips with very low bitdepth & storage size.  Typically used in kid's toys to play a few pre-recorded farm animal noises.

More modern: flash storage and mp3 codec chip.  Almost unlimited sound length & selection.  MP3 is not the best option (and their implementations are often not perfect) but it's "the standard" with lots of different vendors making these chips.

The way I last did it:  8 bit microcontroller with lots of internal flash storage space and a cheap I2S DAC.  I2S is a very simple protocol, bang those bits and sound magically comes out of the DAC chip.  The datasheet for the DAC chip will suggest an output filter.  Duration is much shorter than the mp3 option, but it was enough for some voice clips of numbers.


What are you trying to make?  A one-off or mass manufacture?  Sound duration?  Number of clips?  Quality?
Title: Re: pre-recorded sound chip?
Post by: ataradov on September 11, 2022, 10:40:33 pm
Big Clive just looked at a toy that has one of those MCUs with a dedicated sound playback capabilities.

MCUs used there are probably https://www.tritan.com.tw/en/Products/1/1175/4-bit-OTP-Speech (https://www.tritan.com.tw/en/Products/1/1175/4-bit-OTP-Speech)

https://www.youtube.com/watch?v=lojd54jPyww (https://www.youtube.com/watch?v=lojd54jPyww)
Title: Re: pre-recorded sound chip?
Post by: SiliconWizard on September 12, 2022, 12:43:23 am
There are those chips like the ISD18xx (the xx being the duration in s of total record time), such as the ISD1820. Or the LX20LYA. You can find them on Aliexpress or through brokers. While one can still find some in DIP package, most of the offering is in the form of bare dies, so it's really for high-volume production, but you can find tons of dev boards, again on Aliexpress, if you want to evaluate them.

https://www.aliexpress.com/item/4001300713795.html (https://www.aliexpress.com/item/4001300713795.html)
Title: Re: pre-recorded sound chip?
Post by: quadtech on September 12, 2022, 05:19:23 am
There are some projects which use esp32 or a Raspberry Pi Pico as a sound player which may be
preferable in these times of chip shortages -

https://www.recantha.co.uk/blog/?p=20950 (https://www.recantha.co.uk/blog/?p=20950)

https://www.coderdojotc.org/micropython/sound/07-play-audio-file/ (https://www.coderdojotc.org/micropython/sound/07-play-audio-file/)

https://circuitdigest.com/microcontroller-projects/esp32-based-audio-player (https://circuitdigest.com/microcontroller-projects/esp32-based-audio-player)

https://hackaday.com/2020/06/14/esp32-becomes-music-player-in-under-40-lines-of-code/ (https://hackaday.com/2020/06/14/esp32-becomes-music-player-in-under-40-lines-of-code/)
Title: Re: pre-recorded sound chip?
Post by: rooppoorali on September 12, 2022, 11:48:32 am
UM66 is a very common music IC. There are some modules featuring 'happy birthday, 'dog sound', 'ding dong' etc. But the part numbers are sealed in those. So, it can't be really figured out which ICs are there. 
Title: Re: pre-recorded sound chip?
Post by: unknownparticle on September 12, 2022, 12:19:50 pm
Thanks guys.
My project is to construct small modules that will play a short clip, maybe 5 seconds, of the sound of racing car engines.  These will be fitted to display cases of my many model cars so that by a button press the sound of that cars real life sound can be heard.
It would be good for the sound quality to be reasonable, within the constraints of the small speaker and amp that can be accommodated  within the display cases.
So, which would be the best chip for this and how is the sound clip loaded? Just an MP3 file or similar?
Title: Re: pre-recorded sound chip?
Post by: mikeselectricstuff on September 12, 2022, 12:36:34 pm
For 5 secs, SPI flash, DAC and MCU is probably the way to go. You don't even need to have the data pass through the micro - just have the flash Dout go to DAC Din, send the read command and just send a continuous clock.
Title: Re: pre-recorded sound chip?
Post by: Miyuki on September 12, 2022, 03:26:53 pm
Exactly, for 5 seconds just dump that few KB from any flash to DAC
I have some projects where I have VS1000, they came as a nice DIP module with everything needed, just put it in the socket
But for a single short clip, it is overkill
Title: Re: pre-recorded sound chip?
Post by: james_s on September 12, 2022, 05:08:50 pm
You don't even need a DAC necessarily, some parts like the attiny85 have a fast PWM mode that can be used as a PWM DAC directly. http://elm-chan.org/works/sd8p/report.html (http://elm-chan.org/works/sd8p/report.html) Not whether you could get enough samples for decent quality audio in the internal memory though.
Title: Re: pre-recorded sound chip?
Post by: floobydust on September 12, 2022, 09:19:24 pm
OP I would be lazy and just get a MP3 player board, instead of making one from scratch.
They come with a 1-3W amp, TF card or USB to download an audio file etc. using DY1703 IC for example. They take pushbuttons for input.
https://www.aliexpress.com/item/32271693515.html (https://www.aliexpress.com/item/32271693515.html) or a bit expensive https://www.aliexpress.com/item/33057384231.html (https://www.aliexpress.com/item/33057384231.html)
Title: Re: pre-recorded sound chip?
Post by: mikeselectricstuff on September 13, 2022, 08:50:49 am
OP I would be lazy and just get a MP3 player board, instead of making one from scratch.
They come with a 1-3W amp, TF card or USB to download an audio file etc. using DY1703 IC for example. They take pushbuttons for input.
https://www.aliexpress.com/item/32271693515.html (https://www.aliexpress.com/item/32271693515.html) or a bit expensive https://www.aliexpress.com/item/33057384231.html (https://www.aliexpress.com/item/33057384231.html)
If end-users need to update content then this is definitely the way to go. I'd go for the USB ones for simplicity - just plug in and they appear as s drive, no software needed
https://www.aliexpress.com/item/1005001545487340.html (https://www.aliexpress.com/item/1005001545487340.html)
Title: Re: pre-recorded sound chip?
Post by: Siwastaja on September 13, 2022, 09:19:59 am
AFAIK, the ISD18xx series and similar old audio chips are actually sampled analog storage, kind of analog FLASH memory. Time is discrete with timesteps (samples), but actual values are stored in charge (and converted back to analog voltage), with no ADC / DAC at all.

Now, I would just do it with a cheapest STM32 or similar I can find, they even come with a DAC if you don't want to use a PWM DAC. Internal flash can store seconds of poor quality audio.
Title: Re: pre-recorded sound chip?
Post by: macboy on September 13, 2022, 05:06:47 pm
128K x 8 bit parallel FLASH or EPROM, with R2R resistor ladder on the outputs to act as a "DAC". You just need to step up through the addresses at around 22 kHz to 25 kHz. For engine sound effects, the 22k/8b sound is quite sufficient. You could get away without a micro, but a micro would be a simple way to generate the addresses. The data never needs to pass in/out of the micro. You could do a similar thing with a serial storage device, reading into the micro then presenting each byte to an 8 bit I/O port, used as the R2R DAC.

Even simpler, create a "one bit" DAC (aka DSD) using a 512 kB serial EEPROM or FLASH, with bits clocked out at around 800 kbit/s. Pass the serial data output through a simple 2nd order low-pass filter (~10 kHz) and a DC blocking cap, then amplify. Just issue a single read command and clock out the entire array consecutively. Make sure your chosen device can do that, and isn't limited to a page or something. The fidelity can be quite good; Super Audio CD uses 2.8 MHz bit rate per channel and achieves audio quality >>CD. The difficulty here might be creating the noise-shaped single bit data stream for the audio.  Since DSD is somewhat common, maybe modern audio editing software can export a DSD or DXD file that you can parse the raw data out of, to program the storage device.
Title: Re: pre-recorded sound chip?
Post by: james_s on September 13, 2022, 06:11:55 pm
Those little MP3 boards seem like the way to go. Under $2 each and just plug into USB to load the audio. You couldn't build something for less than that.
Title: Re: pre-recorded sound chip?
Post by: unknownparticle on September 13, 2022, 07:22:26 pm
Thanks guys, thats just the sort of thing I need, and the price I'd hoped for!  :-+
Title: Re: pre-recorded sound chip?
Post by: james_s on September 13, 2022, 07:31:51 pm
They are shockingly cheap, I had expected a comparable ready made solution to cost at least 10 times what those do. I have a few projects of my own I might try using those for.
Title: Re: pre-recorded sound chip?
Post by: RJSV on September 14, 2022, 03:52:18 am
   In 2017 I had purchased a couple of Recordable Message Greeting cards.  The little circuit board included a microphone, and did something like 15-20 seconds time, and could be re-used numerous times.
   I included that card into a child's toy 'electronics' box, having various switches.  Also included a little music playing circuit.
   Kid could play the canned thing; record into the custom audio recorder unit, then could play both audio sources (2 speakers).  The enclosure was one of those simple soft plastic 'food' container, but with great big handle, so 3 year old could lug it around the house.
  Previous to my arrival on the scene, the kid had been 'interested', in the (lethal) AC outlet 'Tricity and where it came from...poking metal and things into the socket.
   Suffice it to say, Mom tended to discourage any such wall socket explorations.
Title: Re: pre-recorded sound chip?
Post by: MathWizard on September 14, 2022, 08:29:39 am
I figured out how to make an arbitrary number of pulses with a cd4024 binary counter, and BJT logic. And to trigger off an arbitrary pulse, or pulses, and splice it all up to get what you need. So that opens up a whole range of new stuff, including making music from logic gates. Add some shift registers and memory and it could be even better.
Title: Re: pre-recorded sound chip?
Post by: mikeselectricstuff on September 14, 2022, 09:24:08 am
ISTR there are some SPI flash chips that can be configured to output data with just a clock ( i.e. no read command), may be possible to use one of these with a DAC and just an oscillator
Title: Re: pre-recorded sound chip?
Post by: unknownparticle on November 14, 2022, 01:28:10 pm
Just found exactly what I was looking for, it may have been what was mentioned above,

https://www.ebay.co.uk/itm/203919536499?hash=item2f7a8d3173:g:eOcAAOSwsx9iYCXe&amdata=enc%3AAQAHAAAA4PRR%2FSXROtEszlzt4Z6pgVOVf7JdLoyggx4FYteVUdGbccspw5zUC03geKaS2BFm%2BxKGWTtkQTLMdVbmbO0W9VaTyOU%2BVCtkwdgGE1YwyIPBqpEy3pFfTp5d9BIFi0zOiHmM4aHdj%2B7Tc2IRsKbwvi1HM8Otss5nNyLvrkXbuiW%2BeVJ%2FdjODF5M%2Fhllq7GL%2BPT3liFlGtzEpiKV2zpC0ysOPYmVO0Ty4zqgqOF3imk4UPdiziDLUovp34xab505oiMynnw8xi1eWORQAp1BASFBiS2QWx9AD13IIpZbcMWZN%7Ctkp%3ABFBMmOHp5I5h (https://www.ebay.co.uk/itm/203919536499?hash=item2f7a8d3173:g:eOcAAOSwsx9iYCXe&amdata=enc%3AAQAHAAAA4PRR%2FSXROtEszlzt4Z6pgVOVf7JdLoyggx4FYteVUdGbccspw5zUC03geKaS2BFm%2BxKGWTtkQTLMdVbmbO0W9VaTyOU%2BVCtkwdgGE1YwyIPBqpEy3pFfTp5d9BIFi0zOiHmM4aHdj%2B7Tc2IRsKbwvi1HM8Otss5nNyLvrkXbuiW%2BeVJ%2FdjODF5M%2Fhllq7GL%2BPT3liFlGtzEpiKV2zpC0ysOPYmVO0Ty4zqgqOF3imk4UPdiziDLUovp34xab505oiMynnw8xi1eWORQAp1BASFBiS2QWx9AD13IIpZbcMWZN%7Ctkp%3ABFBMmOHp5I5h)

Available even cheaper direct from China!

Title: Re: pre-recorded sound chip?
Post by: mariush on November 14, 2022, 03:13:35 pm
For around 3.5$ you can get a usb mp3 player with buttons and everything. Put a single mp3 file on the usb stick and expose only the play button ( either by removing the other buttons or by soldering a couple wires to the play button contacts and adding your own play button
The same model can probably be found for cheaper on aliexpress or somewhere else.

forgot to post link as example of such player: https://www.ebay.com/itm/155017739870 (https://www.ebay.com/itm/155017739870)
Title: Re: pre-recorded sound chip?
Post by: Alex Eisenhut on November 14, 2022, 03:42:04 pm
https://www.amazon.com/VoiceGift-Voice-Over-Voice-Recorder-Recording/dp/B097XWLRNQ/ref=sr_1_8?keywords=voice+recording+picture+frame&qid=1668440475&sr=8-8 (https://www.amazon.com/VoiceGift-Voice-Over-Voice-Recorder-Recording/dp/B097XWLRNQ/ref=sr_1_8?keywords=voice+recording+picture+frame&qid=1668440475&sr=8-8)
Title: Re: pre-recorded sound chip?
Post by: unknownparticle on November 14, 2022, 04:40:20 pm
Thanks both.
I was looking for the most compact solution so those stand alone players are too big and clunky for my application.  The device has to fit in the base of a fairly small display case with just a button discreetly exposed to operate it.  So the DFP mini is ideal, just needs a battery and speaker to operate for my needs.
Title: Re: pre-recorded sound chip?
Post by: RJSV on November 15, 2022, 12:47:09 am
   My lazy approach was buying a birthday card, that included even a little electret mic, and you just press record, as the button batteries are already there.
Maybe 6 seconds of record time, had a record button, play button and little 1 inch speaker.
That speaker is easy to upgrade, maybe including a 10 ohm or 5 ohm series resistor, if you use an 8" speaker.
   You will have to search on that 'Recordable Greeting card".
Title: Re: pre-recorded sound chip?
Post by: TheUnnamedNewbie on November 15, 2022, 08:04:12 am
Makes me wonder how many birthday cards you need to sell before it becomes worth going to a custom asic house and have your own asic made specifically for this.
Title: Re: pre-recorded sound chip?
Post by: ledtester on November 15, 2022, 10:59:35 am
Here's the guts of a recordable sound birthday/greeting card:

https://www.aliexpress.us/item/2251832695413914.html (https://www.aliexpress.us/item/2251832695413914.html)