Author Topic: Sound/Voice like on talking doll?  (Read 11286 times)

0 Members and 1 Guest are viewing this topic.

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Sound/Voice like on talking doll?
« on: February 22, 2016, 10:07:59 pm »
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?
« Last Edit: February 22, 2016, 10:09:44 pm by nardev »
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #1 on: February 23, 2016, 12:04:01 am »
Thnx but not that i need something very simple, small (keychain size) and cheap to build. 
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3642
  • Country: us
Re: Sound/Voice like on talking doll?
« Reply #2 on: February 23, 2016, 12:09:08 am »
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.
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #3 on: February 23, 2016, 12:27:06 am »
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.
 

Offline DTJ

  • Frequent Contributor
  • **
  • Posts: 997
  • Country: au
Re: Sound/Voice like on talking doll?
« Reply #4 on: February 23, 2016, 08:07:18 am »

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.
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #5 on: February 23, 2016, 08:16:26 am »
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
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16666
  • Country: 00
Re: Sound/Voice like on talking doll?
« Reply #6 on: February 23, 2016, 10:28:08 am »
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
You can get the modules easily enough, eg. http://www.ebay.com/sch/i.html?_nkw=chip+sound+module

But...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"
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #7 on: February 23, 2016, 11:41:58 am »
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
You can get the modules easily enough, eg. http://www.ebay.com/sch/i.html?_nkw=chip+sound+module

But...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"


exactly

So, to repeat

1. I need something very cheap
2. 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 anything
5. i don't want kit, i need experienced suggestion, what is the best approach

6. 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...
 

Offline DTJ

  • Frequent Contributor
  • **
  • Posts: 997
  • Country: au
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #9 on: February 24, 2016, 11:15:33 am »
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

Yes, 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...
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: Sound/Voice like on talking doll?
« Reply #10 on: February 25, 2016, 09:01:59 am »
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.

Almost 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.
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #11 on: February 25, 2016, 09:47:10 am »
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.

Almost 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.

Tell me please how to "convert" the sound i have now into format which i can write in microcontroller?
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16666
  • Country: 00
Re: Sound/Voice like on talking doll?
« Reply #12 on: February 25, 2016, 09:51:24 am »
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.
Almost 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.

Yep. 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.
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #13 on: February 25, 2016, 09:53:42 am »
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.
Almost 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.

Yep. 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.

great, i see the point, i accept it...

the question is "mp3 => to => binary/hex" ? so that i can record the sound on microcontroller?
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16666
  • Country: 00
Re: Sound/Voice like on talking doll?
« Reply #14 on: February 25, 2016, 10:15:09 am »
the question is "mp3 => to => binary/hex" ? so that i can record the sound on microcontroller?

That's going to depend on your playback software.

...and most playback software comes with instructions on encoding the sound.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Sound/Voice like on talking doll?
« Reply #15 on: February 25, 2016, 03:01:46 pm »
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.htm

That 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.

 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: Sound/Voice like on talking doll?
« Reply #16 on: February 25, 2016, 03:08:30 pm »
the question is "mp3 => to => binary/hex" ? so that i can record the sound on microcontroller?

There 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.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8172
  • Country: fi
Re: Sound/Voice like on talking doll?
« Reply #17 on: February 25, 2016, 03:32:07 pm »
Tell me please how to "convert" the sound i have now into format which i can write in microcontroller?

Write 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.
« Last Edit: February 25, 2016, 03:34:12 pm by Siwastaja »
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Sound/Voice like on talking doll?
« Reply #18 on: February 25, 2016, 04:17:24 pm »
TI have PWM speech example http://www.ti.com/lit/an/slaa405a/slaa405a.pdf with 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 too :) After all 7 or even 6 bits are still good for rough speech output.
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 16666
  • Country: 00
Re: Sound/Voice like on talking doll?
« Reply #19 on: February 25, 2016, 08:17:53 pm »
At 16MHz clock 8-bit PWM period is ~62 KHz - out of audio range and most probably speaker range too :) After all 7 or even 6 bits are still good for rough speech output.

An 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.
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4531
  • Country: au
    • send complaints here
Re: Sound/Voice like on talking doll?
« Reply #20 on: February 26, 2016, 12:37:40 am »
and as i said, i need something very cheap and easy to assemble, so if possible, without microcontroller??
These 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.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: Sound/Voice like on talking doll?
« Reply #21 on: February 26, 2016, 11:54:18 am »
Tell me please how to "convert" the sound i have now into format which i can write in microcontroller?

Google 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.
 


Offline @rt

  • Super Contributor
  • ***
  • Posts: 1059
Re: Sound/Voice like on talking doll?
« Reply #23 on: February 26, 2016, 03:15:56 pm »
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.


 

Offline justanothercanuck

  • Frequent Contributor
  • **
  • Posts: 391
  • Country: ca
  • Doing retro repairs...
Re: Sound/Voice like on talking doll?
« Reply #24 on: February 27, 2016, 11:00:12 am »
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.
Maintain your old electronics!  If you don't preserve it, it could be lost forever!
 

Offline RobertBG

  • Regular Contributor
  • *
  • Posts: 126
  • Country: us
Re: Sound/Voice like on talking doll?
« Reply #25 on: February 27, 2016, 09:59:59 pm »
I did a setup loosely based off of this and I was around 3$ per unit for 500 http://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  :-+
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9951
  • Country: nz
Re: Sound/Voice like on talking doll?
« Reply #26 on: February 27, 2016, 10:07:45 pm »
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
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #27 on: February 29, 2016, 12:37:00 am »
Thank you all guys. you were so helpful.

I'm never disappointed with this forum.
 

Offline nardevTopic starter

  • Supporter
  • ****
  • Posts: 411
  • Country: ba
Re: Sound/Voice like on talking doll?
« Reply #28 on: May 17, 2016, 05:09:36 am »
If anyone needs this again, here is all you need for "demo".

http://playground.arduino.cc/Code/PCMAudio


If 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf