Sound/Voice like on talking doll? - Page 1
Forum section: electronics / projects

author: nardev
author_rank: Unknown
timestamp: February 22, 2016, 10:07:59 pm
content: Hello guys, i need to make something very very very cheap, which needs to be built in ~10K peaces.Thing is very basic, i have very simple and short audio which i need to reproduce once one button is pressed. It doesn't need to be good sound, and it needs to be in a size of keychain.Only one long word and that is all.Please help me with a parts. I think piezo speaker could do that, (flat one like coin) but i don't know if it is possible to make it without any microcontroller to "say" something". and as i said, i need something very cheap and easy to assemble, so if possible, without microcontroller??If not, than what would be the most affordable and most easy to build option?

author: nardev
author_rank: Unknown
timestamp: February 23, 2016, 12:04:01 am
content: Thnx but not that i need something very simple, small (keychain size) and cheap to build.

author: helius
author_rank: Super Contributor
timestamp: February 23, 2016, 12:09:08 am
content: A microcontroller is the simplest, cheapest approach. Just about any 8-bit MCU can be programmed for low-fidelity audio, and in many cases will not even need an external amplifier. There are special voice synthesizer chips but I don't believe they can compete in price or simplicity.

author: nardev
author_rank: Unknown
timestamp: February 23, 2016, 12:27:06 am
content: What would you go for? How to convert sound to appropriate format so that the word could be understood? This last step is big mystery for me.

author: DTJ
author_rank: Super Contributor
timestamp: February 23, 2016, 08:07:18 am
content: Look at talking greeting cards.A guy I knew had a similar need and tracked down the company who made the tiny sound units for novelty greeting cards.

author: nardev
author_rank: Unknown
timestamp: February 23, 2016, 08:16:26 am
content: Could you find our more? Which company? I'm willing to pay for a complete solution. Herbert it's needs to be about 1-2 USD per unit

author: Fungus
author_rank: Super Contributor
timestamp: February 23, 2016, 10:28:08 am
content: Quote from: nardev on February 23, 2016, 08:16:26 amYou can get the modules easily enough, eg.http://www.ebay.com/sch/i.html?_nkw=chip+sound+moduleBut...who's going to sit and record sound onto 10,000 of them? That would be madness.You need to find somebody with a machine that pre-programs the chips.Google stuff like "pre-programmed greeting card sound chips"

author: nardev
author_rank: Unknown
timestamp: February 23, 2016, 11:41:58 am
content: Quote from: Fungus on February 23, 2016, 10:28:08 amexactlySo, to repeat1. I need something very cheap2. size needs to be something as keychain (Like, executor in '80s)3. able to produce 2-3 seconds of sound, however, it is not just polyphonic melody it is something which needs to resemble to a human voice/word, i have the sound already)4. don't need to have mic and to be able to record multiple times anything5. i don't want kit, i need experienced suggestion, what is the best approach6. how to convert my mp3 to some 8 bit sound and keep it bit understandable?Should i use some king of cheap IC? Should i just get cheap smd AtMega's and hook piezo directly, would it work like that and would it be able to produce the sound i need?etc...

author: DTJ
author_rank: Super Contributor
timestamp: February 24, 2016, 08:59:38 am
content: Have you dredged through this lot?https://www.google.com.au/search?q=greetoimng+card+soucd+chip&gws_rd=cr,ssl&ei=nnDNVsbmLYmw0ASn1IXIBA#safe=off&q=greeting+card+sound+module

author: nardev
author_rank: Unknown
timestamp: February 24, 2016, 11:15:33 am
content: Quote from: DTJ on February 24, 2016, 08:59:38 amYes, actually i just got some contacts on alibaba, seems like they can even make something like i need... (although i prefer to design it) but unless 10.000 ordered price is not so great...

author: mikerj
author_rank: Super Contributor
timestamp: February 25, 2016, 09:01:59 am
content: Quote from: nardev on February 23, 2016, 12:27:06 amAlmost any microcontroller can play back a basic sampled sound, the limiting factor is memory size. You can use an AC coupled PWM output to drive drive a small speaker, though a small external driver may be required to give sufficient volume.e.g. 3 seconds of sound at 8kHz sample rate and 8bits per sample is 24k for a simple PCM implementation. An encoding scheme such as ADPCM can easily drop that by 50% or more whilst still being feasible to implement on a low powered 8 bit micro. You could store the sample on an external serial EEPROM, but costs will obviously increase.

author: nardev
author_rank: Unknown
timestamp: February 25, 2016, 09:47:10 am
content: Quote from: mikerj on February 25, 2016, 09:01:59 amTell me please how to "convert" the sound i have now into format which i can write in microcontroller?

author: Fungus
author_rank: Super Contributor
timestamp: February 25, 2016, 09:51:24 am
content: Quote from: mikerj on February 25, 2016, 09:01:59 amYep. There's any number of them that could do it, eg. Atmel Tiny85 would have probably enough memory for this (8k of flash). I'm not sure if there's an 8-pin chip with more onboard flash memory than that, but whatever ... it's doable.The problem is putting it all together into a nice module and getting all the chips programmed with the sound. Doing it by hand in that sort of quantity would be madness and a custom-made PCB, etc. will be expensive. Much better to look for a premade solution. I'm sure there must be one out there - I can buy keychains that flash and make a sound in any dollar store.

author: nardev
author_rank: Unknown
timestamp: February 25, 2016, 09:53:42 am
content: Quote from: Fungus on February 25, 2016, 09:51:24 amgreat, i see the point, i accept it...the question is "mp3 => to => binary/hex" ? so that i can record the sound on microcontroller?

author: Fungus
author_rank: Super Contributor
timestamp: February 25, 2016, 10:15:09 am
content: Quote from: nardev on February 25, 2016, 09:53:42 amThat's going to depend on your playback software....and most playback software comes with instructions on encoding the sound.

author: Buriedcode
author_rank: Super Contributor
timestamp: February 25, 2016, 03:01:46 pm
content: A few years ago when I found out I was going to be an uncle, I 'toyed' (see what I did there?) with little sound generators.Specifically, small flash chip + microcontroller + opamp +speaker. I believe it was the Attiny461 which had 'high speed' PWM (on board RC clock @ 64MHz that could driver the timer/counter for high speed PWM). Because of the high speed, I could get away with a cheaper LPF after it, although it played samples at 10-bit 16ksps, the cut-off was at roughly 7kHz, and it sounded surprisingly good for what it was.For sound effects, or just samples where you can understand human speech, you can of course go lower. Telephone quality is 300Hz-3kHz anyway. The microcontroller part is relatively easy as all it does is periodically grab samples from the flash (SPI) and change its PWM. A few buttons just picked the start address in the external flash, the first two bytes in that location would contain how many samples it was - the length of it. I wrote a pretty basic (and awful) VB app that read in a *.wav file, and sent it over the serial port to the micro, which then loaded the flash with it. The *.wav's were converted to 16-bit @ 16kHz using 'windows sound recorder'. Only the upper 10-bits of each sample were used, because it requires two bytes to store that anyway, and I couldn't find free software to convert audio clips to 10-bit. (would probably do that all in a C# app now).I revisited that project recently just to see how 'cheap' I could get it. And was reminded of this:http://www.romanblack.com/BTc_alg.htmThat can help reduce the part count, but you'll probably still need external memory. 'Synthesizing' voice is extremely difficult, but just playing pre-recorded samples is very straight-forward for hardware, and given how cheap memory is these days, an SPI flash chip won't add much cost. Some PIC's have built-in opamps, like the PIC16F1704, as well as an 8-bit DAC. It also has a couple of PWM modules if you wish to use those. That would be a two-chip solution which I suspect could actually do fairly decent quality sound.You might be able to get away with an 8-pin micro (using one ADC pin to read several buttons), an 8-pin flash chip ($0.50 for 4MBit) and a single transistor speaker driver. Although commercial cheap devices generally use custom IC's and are extremely cheap, this is the cheapest (also easiest) way I can think of to make a small 'sound module' that plays small sound clips.

author: Buriedcode
author_rank: Super Contributor
timestamp: February 25, 2016, 03:08:30 pm
content: Quote from: nardev on February 25, 2016, 09:53:42 amThere are various 'free' bits of software for that, Audacity spings to mind, but I am sure there are smaller ones. Since the advent of the arduino, 'playing sounds' has become more popular, so there are pages like this to help:http://hellomico.com/getting-started/convert-audio-to-raw/I used to convert to raw, then wrote a bit of software to generate a rom table from that. I'm pretty sure someone in the 'arduino' community as done that. Just be sure to convert your audio clip to the correct sample rate that you're going to play back with.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 25, 2016, 03:32:07 pm
content: Quote from: nardev on February 25, 2016, 09:47:10 amWrite a simple python, matlab or any script or program in your language of choice, that reads in a .wav file and outputs a C header like:sample.h:const __flash uint8_t audio_data ={123, 222, 111, 5, etc, you, get, the, idea...};Then write a simple program which outputs sample at a time to the on-chip PWM generator, like#include "sample.h"void main(){/* initialize PWM here */uint16_t cur_sample = 0;while(1){PWM_COMPARE_REGISTER = audio_data[cur_sample++];while(/*wait for pwm timer overflow */);}}Make the PWM quick enough and you have just made a sound storage AND a poor class D amplifier controller in one simple solution! Just AC couple the output.

author: ogden
author_rank: Super Contributor
timestamp: February 25, 2016, 04:17:24 pm
content: TI have PWM speech examplehttp://www.ti.com/lit/an/slaa405a/slaa405a.pdfwith source code. Also I recall thet they have ADPCM library somewhere around. Hint: if good sound quality is not required, you can drive speaker through complementary mosfet pair, possibly without filter. At 16MHz clock 8-bit PWM period is ~62 KHz - out of audio range and most probably speaker range tooAfter all 7 or even 6 bits are still good for rough speech output.

author: Fungus
author_rank: Super Contributor
timestamp: February 25, 2016, 08:17:53 pm
content: Quote from: ogden on February 25, 2016, 04:17:24 pmAn ATTiny85 can run Timer1 at 64MHz using its internal PLL. That gives you a 250kHz PWM output. Neener, neener...http://www.atmel.com/images/doc2542.pdf(Yeah, they talk about the Tiny26 there but the Tiny85 can do it too)If you're outputting into (eg.) the air then you probably don't even need a filter.I'd say the Tiny85 is the chip for the job if the budget can stand it. They're about 75 cents each in those sort of quantities. Add a PCB, a push button, a battery, a speaker, a couple of caps... Job done for about $1.50. Maybe less.

author: Someone
author_rank: Super Contributor
timestamp: February 26, 2016, 12:37:40 am
content: Quote from: nardev on February 22, 2016, 10:07:59 pmThese are conflicting requirements.The cheapest solution are the greeting card type products where a mask programmed chip (relatively high NRE cost) is bonded to each circuit board and encapsulated, it connects directly to a speaker and the battery holder may double as part of the switch. These require specialised and expensive equipment to assemble.Something you can build yourself is the opposite side, and will cost much more than a part delivered from someone specialising in producing these products. You won't save money by designing or building it yourself, and searching for a supplier is exceptionally easy with google.

author: mikerj
author_rank: Super Contributor
timestamp: February 26, 2016, 11:54:18 am
content: Quote from: nardev on February 25, 2016, 09:47:10 amGoogle is your friend, there are quite a few tools have have been written to convert wav file to C arrays, e.g.wav2c. There are hundreds if not thousands of tools to convert MP3 to wav files.

author: bombledmonk
author_rank: Regular Contributor
timestamp: February 26, 2016, 02:35:27 pm
content: There's a whole family of these products at Digikey.http://www.digikey.com/product-search/en/integrated-circuits-ics/interface-voice-record-and-playback/2556441Complete demo boards are available also.http://www.digikey.com/product-search/en/programmers-development-systems/evaluation-and-demonstration-boards-and-kits/2622039?k=&pv1000=25&FV=fff40028%2Cfff80257&mnonly=0&newproducts=0&ColumnSort=100001&page=1&quantity=0&ptm=0&fid=0&pageSize=25&akamai-feo=off

author: @rt
author_rank: Super Contributor
timestamp: February 26, 2016, 03:15:56 pm
content: Some years ago I used Roman Black’s BTC algorithm with 8 bit micro, so that’s the software for free at least.Later I got smaller chips to fit in a greeting card.

author: justanothercanuck
author_rank: Frequent Contributor
timestamp: February 27, 2016, 11:00:12 am
content: not sure if they're still publicly available, but in the 90s we had this little toy sample recorder called a yak-bak. it had like a 2 second limit or something, and two buttons. it was simple but amazing for the time.

author: RobertBG
author_rank: Regular Contributor
timestamp: February 27, 2016, 09:59:59 pm
content: I did a setup loosely based off of this and I was around 3$ per unit for 500http://hackaday.com/2013/06/11/giving-toys-an-electronic-voice/I'm sure that could be trimmed down and some of what we did could be left out in your case.If that doesnt work for you I'd go with a existing product

author: Psi
author_rank: Super Contributor
timestamp: February 27, 2016, 10:07:45 pm
content: Cheapest solution is going to be the greeting card ICs, however i think those are maskrom so have to be manufacture with the sound (ie they are not programmed).Easiest solution that's still cheap is using the cheapest micro you can find with the audio samples stored in flash along with the code.Not sure if a PWM DAC will be fast enough, should be.But a cheap audio amp made from discrete components is cheap as well

author: nardev
author_rank: Unknown
timestamp: February 29, 2016, 12:37:00 am
content: Thank you all guys. you were so helpful.I'm never disappointed with this forum.

author: nardev
author_rank: Unknown
timestamp: May 17, 2016, 05:09:36 am
content: If anyone needs this again, here is all you need for "demo".http://playground.arduino.cc/Code/PCMAudioIf you need 10k+ of devices, you can order custom audio chip from alibaba at a rate of .40-.70 per device. They can even make you custom enclosure.