Audio playback with SX & EEPROM
Bean
Posts: 8,129
Has anyone ever tried this ?
I'm wondering what the sound quality difference will be between using PWM and an RC filter with just one pin against using a 8-bit DAC ?
A client of mine is intested in a circuit that will (among other things) playback a 10 second sound clip. I know there are circuits that will do just that, but the SX is going to be in the circuit anyway and I thought with just the cost of the EEPROM, a LM386 and a speaker I could do the sound too.
He only needs telephone quality (8-bits @ 8KHz).
This project is high volume(10K) and is very cost sensitive. So I would like to not use the DAC if possible.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
I'm wondering what the sound quality difference will be between using PWM and an RC filter with just one pin against using a 8-bit DAC ?
A client of mine is intested in a circuit that will (among other things) playback a 10 second sound clip. I know there are circuits that will do just that, but the SX is going to be in the circuit anyway and I thought with just the cost of the EEPROM, a LM386 and a speaker I could do the sound too.
He only needs telephone quality (8-bits @ 8KHz).
This project is high volume(10K) and is very cost sensitive. So I would like to not use the DAC if possible.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
·· Before Sound Cards came down some of us used our Printer Port to make a cheap DAC using an R2R resistor network.· It wasn't the greatest, but it worked.· Given that I think your idea could too...It would really depend on the Read Speed of the EEPROM more than anything else I would guess.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
you can find an example for a R2R resistor network DAC in my book (page 272).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
Actually, tons of CD players use pretty much this exact approach (PWM) and they sound great. I think they are called sigma-delta convertors, and basically what you have to do is tradeoff DAC speed for bits. In other words, these convertors typically run at 256X the normal conversion rate. The idea is to output such a huge number of 1s and 0s that when integrated it sounds like normal audio.
Take a look at the following (note that these just seemed like promising Google hits - I haven't actually read them myself):
www.embedded.com/showArticle.jhtml?articleID=22101730
www.analog.com/UploadedFiles/Presentations/1496341255ICCE.pdf
www.maxim-ic.com/appnotes.cfm/appnote_number/1870
The last one is actually about ADC, but I think it may have relevant info.
Thanks, PeterM
The sound itself is not the problem, it is the retention of the overtones and all the color. It seems the better your DAC, the more faithful the sound. Sampling at 256x the normal converson rate seems very appropriate, but huge.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Post Edited (Kramer) : 2/3/2006 4:38:44 PM GMT
·· You could always build a prototype and try the R2R method I mentioned.· If Guenther has an example all the better.· It really depends on the quality you are looking for.· I don't think they're that bad, but I am not comparing it to my SB Audigy 2 ZS Sound Card.· I am comparing to an ISD chip or something more that quality of sound.· It would, in all likelihood sound much better.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Here is a forgotten but not lost archive of mine from my old web page...
webpages.charter.net/schwabelove/BasicStamp/wavprom.gif
...it's only 2.9 seconds at 11kHz 8-bit mono, but it's only using a 32k EPROM.
You can always add more memory, or lower the quality to 8kHz ( I wouldn't
go much lower )
It was great for putting in sound bytes with things like....
" 'Beep' 'Beep' 'Beep' Kirk to enterprise "
...The only thing you need to do to the WAV file is to strip off the 44 byte header.
Even this isn't critical, if you don't, you just hear a "Pop" at the beginning of the
audio. I usually did this from the burner software.... visually you can see this
location in the HEX table by a series of 7F and 80 numbers representing the audio
"null" or midpoint.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 3/4/2006 4:21:07 PM GMT
http://www.romanblack.com/picsound.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Golf Clap!!
Very nice!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I had found the picsound site, but hadn't really examined it. Look interesting.
I'll have to give it a try.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
I would advise that you place an op-amp based (TL082 ? ) active low pass filter to clean out the voice before it goes
into the audio amplifier.
This way you can even use 1pin PWM output safely without using the whole 8 pin port.
Sorry to have to recommend additional costs. : (
I may have to use either a serial dac or a shiftreg (they want 16 LEDs also). Just great, more parts...
Maybe I can talk them into only 8 LEDs ?
P.S. Does anyone know where to get really thin speakers ? Something like 1" to 1.5" diameter but less than 0.20" thick ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
for use in a modem.
I can check sometime during the week for a price if you would like.... (only open Monday - Friday)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Thanks for the offer, but I need a supply of 10K to 50K (over a couple years) for this client.
It's basically a take on the old "greeting card that plays sound" idea.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
What did you mean·when you said that·you can't change the playback sample rate?· You can play it at whatever sample rate you want, just has to be encoded in that sample rate.
I was talking about the PICSOUND program that runs on the PC. It always playsback at 15625Hz. I would have liked to tried a higher sample rate to see if the audio sounded any better, but I don't see any option to change it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
I think I found some speakers that might work for you.... I forgot I had these (originally in an old laptop).
SAM SUNG
2001 N837
These measure 20mm diameter by 3mm height.
Since I'll probably never use the two that I have, I can send them to you if you would like.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 2/6/2006 11:38:32 PM GMT
Cool I would love to try them. I never thought about notebook speakers.
Do you need my address ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
Send me a PM or E-mail with your address, and I will try to get them out to you tomorrow (Tuesday)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I have C program that reads Microsoft wav files and writes out a C header file of the audio data. It will do the conversion from whatever compression is used in the wav file to PCM automatically. Let me know if you'd like it.
I use it for a project involving another microprocessor that has an on-board 8 bit DAC and internal analog low pass filter. The sound quality is excellant.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.speechchips.com
Speech & Video IC's for BasicStamps
Yes I love to see the code. You wouldn't have a schematic for the audio output would you ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
The schematic won't help you much since it's just two pins connected to a speaker with a 33ohm resistor to ground on one of the pins.
The 16 bit version requires an external low pass filter.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.speechchips.com
Speech & Video IC's for BasicStamps
If you're still after speakers, you might want to also look at model railroad sites for speakers used for onboard sound.· One "leading manufacturer" is http://www.soundtraxx.com/
With the·quantities you're after I wouldn't buy from them, but they may be able to direct you to thier source, or you could buy a speaker or two and get the name/number off it (hopefully).
I haven't had a chance to use this stuff, but I've seen/heard it at shows, and they are getting some very good sound out of these units.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John R.
8 + 8 = 10
I have attached and exe that converts wave files to .h files.··I have·attached source.· You'll note that the write routine is hard coded for 8bit @16Khz.· It should be simple to change.··I had to rip it out of another project.· I hope to improve on the program in the future but it's rough.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.speechchips.com
Speech & Video IC's for BasicStamps
Found these speakers:
http://www.goldmine-elec-products.com/prodinfo.asp?number=G13674&variation=&aitem=2&mitem=25
and these:
http://www.goldmine-elec-products.com/prodinfo.asp?number=G14086&variation=&aitem=7&mitem=25
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"OEM NMEA GPS Module" Now available on ebay for only $17.49
Product web site: http://www.allsurplus.net/Axiom/
Post Edited (Mike Cook) : 2/10/2006 9:05:23 PM GMT
Thanks for those links. I'll check them out.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
I downloaded a .WAV file (8-bit 8000 samples per second) to an EEPROM.
When I just put the data onto a DAC I can hear the sound, but there is what sounds like a constant tone in the sound.
I realize there is a header that would have some non-sound info, but is it possible that there is non-sound info WITHIN the data bytes ?
I'm using the old "You've got mail" wav file. I can post it if anyone wants to examine it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Wise men know when they're right. The wisest also·know when they're wrong."
·