This question already has an answer here:
- Playing sounds on an AVR MCU [closed] 3 answers
So, my dog has a 'babble ball', which is a toy ball that plays random sounds when she rolls it around. She loves it, but the sounds are cringe-worthy. I would like to essentially remake this, but playing sounds of my own choosing (in this case, sound snippets from Austin Powers films).
Because it all has to fit in a small plastic ball, space is at a premium, so please bear that in mind - for instance, I -cannot- use a shield. Also, the sound quality doesn't have to be exceptional, given the application.
Currently, I'm planning to use a shake switch to detect when the ball is in motion, and ideally use an arduino chip as the brains. The part I'm struggling with is storing, and playing the audio.
The default Internet suggested option seems to be using pwm to play sound off a microsd card.
I do not want to use a playback chip, as I'm trying to use this as an excuse to learn how to do this.
What I would like to ask, is;
A. Could I store the relevant sound bytes on the arduino itself? Either in the sketch, or some sort of on-board memory? Putting a microsd card in for a couple of seconds max of audio seems overkill.
B. If so, how would one go about doing this?
C. Out of curiosity, how would one play a sound file without the use of a microcontroller? I appreciate it would probably always be easier to use one, but I'm interested if there is some sort of dedicated IC for this purpose.