using another chip to hold audio?

Im not really sure where to put/ask this question..

but instead of using an SD card to hold audio files and try to play them from that using the Arduino..

could I? and would it be easier to use another chip to store/flash the audio file(s) to and then just have the Arduino play them from that?

I know the sounds would be 'static' until flashed another sound on the 'chips'.. Anyone care to give me their general ideas/feedback on this?

Just looking to be enlightened..

Thanks =)

You could use a serial EEPROM to hold the data, I suppose; these are memory devices, kinda like an SD card, but are an individual chip, that are controlled via a serial interface (generally I2C or SPI). However, most are SMT devices, so mounting and using them may require a certain level of skill. Plus, there's the issue of finding one large enough for the application.

BTW - why the aversion to an SD card? They aren't difficult to interface to (from what I have seen - I've never tried, personally), and don't require much in the way of parts to do so...

:)

I recently build a little drumset, which holds a bassdrum-, a snare- and a hihat-sample (8-bit PCM at 22000 kHz samplingrate, doesn’t sound too bad through an amplifier) in the flash of my ATMega168 (via PROGMEM). Reading from the chip’s flash is quick and doesn’t produce any kind of latency (the drums are triggered by piezos). Sound is output via an R2R-Ladder-DAC with OpAmp as voltage follower.
As the need for bigger samples arises, I already had following options:

a) EEPROM: Didn’t really try EEPROMs yet, but I used them for projects in the past. Really easy to interface, but in the libraries available there often are delays in the functions, which would require me to first load sounds into a buffer to play back without lagging (not really good for “real-time” applications.

b) SD-card: just going into this. Depending on the library and your card, interfacing seems to be easy. My particular SD-Card was only recognized by the SDuFat-library, all other libraries (sdFat-library, fat16-library and the ones of lady ada’s waveshield didn’t recognize the card). Go buy a new card if you wanna try this way (mine is a very old one, 256 MB, from an old digital camera). Interfacing requires level-shifting to 3.3V, which must be taken care of (I used 8 NPN-transistors (2N3904)). Most libraries seem to put their focus onto file writing, I had to modify the SDuFat-library to just get into reading raw data from the card (which still doesn’t really work reliably). IMO, documentation for the libraries is mostly a pain in the **s.

c) external RAM: didn’t really get into this one, as addressing always seems to need a lot of I/O-lines (and I simply don’t have one to try yet).

Links from my project notes:

R2R-DAC:
http://blog.makezine.com/archive/2008/05/makeit_protodac_shield_fo.html
http://www.ikalogic.com/dac08.php

SD-Interfacing:
http://www.arduino.cc/playground/Learning/SDMMC
http://www.arduino.cc/playground/Main/EthernetShieldSDHardwareSPIMod
http://code.google.com/p/sdfatlib/
http://code.google.com/p/fat16lib/
http://www.arduino.cc/playground/Code/SDCARD

Edit: Upgrading to a bigger chip (ATMega328 or even 1280 on the Mega) will offer more space for samples in flash (ATMega168: 16kB, ATMega 328: 32kB, ATMega1280: 128kB). Depending on the size and length of your samples this could be enough to store your sound.

Hey guys..thank for the reply.. (when I first got here.. I felt like the forums were DEAD)..lol

Im nto against SD cards.. Im just exploring to be honest.. Im so 'green' with hardware.. Im not sure what is the best approach or not..

basic summary of proejct Id trying to do..

1.) when turned on.. I need to play an audio file.. as soon as that is done playing.. (no lag..no pause).. I need to start another audio file playing..that loops, continuously, while the project is on/powered.

2.) during project 'play'.. if I swing the project.. (accelerate...but not tilt) I need it to play another sound

3.) during project 'play' if I jerk or hit the object.. I need it to play yet a different sound than the 'loop' or the 'swing/acceleration' sound from item #2 above.

I have been attempting to tackle/complete these two steps....using two seperate approaches.. to get the same results..

A.) using an accelerometer... which I am asking for help in this thread: *any help ya got is appreciated) http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1276585144/8#8

&

B.) using analog type sensors/switches (nail & spring......ballbearing switches).. which is located in this thread..

picture of the pcb I made to test this stuff.

again I am need of help/suggestion on where to go next for that approach too.

located here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1277141348/0

and branched off here a bit: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243235304/30

so Im looking a better way to hold these 'sounds' (looks like SD card is the only way?)

Im not sure how big the memory/eeprom chips are? or what they can hold..

I dont think the 328p will have enough flash/progmem to hold all these sounds.. can you load more than one thing into progmem?

my concern is lag/latency when playing these sounds...

when interrupt is triggered.. sound need to play.. (no wait..other wise it will seem slow and not re-active)

thoughts? ideas?

anyone want to help out in one of those threads.. I appreciate the communication :)

=]

Ha Ha that face is smiling because it just ate a load of SPAM

[sarcasm=max]That was great, thanks for spamming the site without even using words!![/spam]

thanks for the double portion.... :)

Sounds like you want to build a lightsaber... ;)

I dont think the 328p will have enough flash/progmem to hold all these sounds.. can you load more than one thing into progmem? my concern is lag/latency when playing these sounds...

That clearly depends on your sounds of course. You can do your bit of math here: 8-bit (1-byte)-PCM audio at a samplingrate of 22000 Hz will need 22000 bytes of memory per second of audio sample. That means the flash on an ATMega168 would keep (approximately): 16kB/22kB = 0,72 seconds of audio. ATMega 328 1,44 seconds, ATMega1280 5,81 seconds. While that may sound like a tiny bit of audio you can go a long way with it. Remember, I have a Snare, Hihat and Bassdrum squeezed into the flash of an ATMega168 (and this also contains the program for actually playing the sounds). If you were, for example, building a lightsaber, you could get away with it by cleverly looping the sounds seamlessly.

yeah most sounds are VERY minute.. however the looping sound in the background is not as small..maybe 1-2 seconds.. where as others are just sound FX..

and you may be right on my project! ;)

just trying to give myself a goal to work toward..

Thanks

I would personally just keep the code in a second Atmega chip and use it as a co-processor.

There are examples of Arduino being used as a Sid Chip emulator on Hackaday's website. Search only does a limited search. You have to go through all of the categories to find anything. Seek and you shall find. Arduino.cc should probably start building an index and archive.

http://hackaday.com/2009/10/13/jamin-to-bach-commodore-64-style/

http://www.roboterclub-freiburg.de/atmega_sound/atmegaSID.html

Dual core Arduino: http://hackaday.com/2008/04/11/dual-core-arduino/