play wave file
JTC
Posts: 60
I have a project that I need to add sound effects to. The two files are 48k bytes and the other is 68k bytes.
What would be the best way to sore and playback on demand?
Could I store them on a 24LC1025 chip and play them the play back when needed?
How would I play it back? I know there is a stereo sound chip on the prop dev board but not sure how to use it.
Thank for any help you can give.
What would be the best way to sore and playback on demand?
Could I store them on a 24LC1025 chip and play them the play back when needed?
How would I play it back? I know there is a stereo sound chip on the prop dev board but not sure how to use it.
Thank for any help you can give.
Comments
My partner, John Barrowman (also a former Parallax employee), and I developed this WAV player for entertainment- and educational-oriented businesses (museums, theme parks, Halloween displays, etc.).
www.efx-tek.com/topics/ap-16.html
Things we learned along the way (the hard way):
1. Put the DAC driver into Cog 1 -- reduces noise
2. If you're going to do serious amplification of the output use Chip's StereoDuty driver to reduce inherent system noise
Note that as our product has to monitor physical inputs and a serial channel *while* playing a WAV file, and we're using 20W amps that will reveal any noise, we have three cogs in use while a WAV file is playing: 1) reads WAV data from SD card into buffers, 2) reads data from buffer and adjusts for channel volume, 3) StereoDuty to output the sample while reducing noise.
I've attached a demo that uses our WAV drivers (variants of the work originally done by Rayman) and Chip's StereoDuty cog to reduce noise. Note that you won't really hear the difference playing through PC speakers connected to the Demo Board; if you use big external amps you will.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
You don't need an SD card for these sound effects drivers.
I imagine there's a lot in the hydra forum too.
Take a look in OBEX...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Apps:· http://www.rayslogic.com/propeller/Programming/Programming.htm
My Prop Info: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
Thanks for the links . I will check them out.
Jim
http://forums.parallax.com/showthread.php?p=906750
I think that does sound effects...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Apps:· http://www.rayslogic.com/propeller/Programming/Programming.htm
My Prop Info: ·http://www.rayslogic.com/propeller/propeller.htm
My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
Is the microSD form factor too large for your application? (Though the spec does not require the uSD cards to support the SPI mode, all of mine work..is this a 1-off project, or do you want to sell millions of them? [noparse][[/noparse]8^)
The HSS (Hydra Sound System www.andrewarsenault.com/hss/index.html) has a 1-bit ADPCM compressed format...it's not good enough for high quality music, but it works.
You could pretty easily support a more standard 4-bit-per-sample ADPCM compression scheme. With 4x compression, you can just barely fit (48k + 68k) into 32k. I'm assuming you have already tried lower sample rates, and lower bits-per-sample for your 2 sound effects?
Jonathan
P.S. @JonnyMac: you may want to update your code to use the safe_spi driver from the latest FSRW 2.6 release..you shouldn't see any speed decrease. I'm also working on a smaller version, which is planned to save some longs, at the cost of a small speed hit. I don't have a lot of free time ATM, but let me know if you are interested, and I'll try to crank it out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
(geek humor escalation => "There are 100 types of people: those who understand binary, and those who understand bit masks")
The project would be one run of 500 units.
What size is the Micro SD. It may work, and that would be great. I like that idea.
There may be future projects that will require more storage.
If I could use the 24LC1025 eeprom in place of the 24lc256 there would be enough room if it is fast enough.
Or maybe adding SPI eprom just for the sound.
Adding the sound effects is the last part of the project and I have no experience with it.
I will look at the Hydra as well. I don't have but about 1" X 2.5" space so I am using the smallest surface mount parts minimumizing the circuits as much as I can. I can put the audio amp about 2 or 3 inches away in another small space. I only need mono.
Thanks
Jim
Post Edited (sssidney) : 7/1/2010 5:34:02 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Post Edited (JonnyMac) : 7/1/2010 7:38:55 PM GMT