Saving a short wav file to Attiny85 via the sketch/memory?

I want to make a small box for my wife with a picture of my son saying a phrase- "I love you" at the press of a button.
I've seen online that several people have used a microSD card to access the file. An sd card seems like a waste for one file.

I was wondering if I could save the audio information in the sketch, using "hoffman code?" I don't know what exactly hoffman code is; but from what i understand it compresses info by reassigning bits to integer values.

Anyway, does anyone know of a way i can play the sound via pwm from the sketch. I'm using this programmer and the Arduino IDE. I don't know much about hex files or fuses.

Can anyone help?

Did you mean Huffman code?

I'm not sure Huffman coding is directly applicable to audio sample files - maybe to signal deltas, but not to the samples themselves.

I was wondering if I could save the audio information in the sketch, using "hoffman code?"

You could but where are you going to expand them to? Not enough SRAM. Not enough processing power.

An sd card seems like a waste for one file.

Welcome to the real world.

Without compression, even one second of low-fi monaural audio (e.g. 3kHz bandwidth) will require more memory than the ATtiny85 has. Perhaps it could be made to fit with compression, but then as Mike says, there are other significant resource issues.

Thanks guys:

can anyone help me with the above? I'm not great at reading schematics (getting better though).

does anyone know of a breadboard fritzing diagram out there that i can play with?

or can anyone explain this a bit better; if i can figure this out...ill use this method...thanks


Interesting project, at least as an end in itself. Seems I've seem small "toy" voice recorders for a few bucks that will record at least for several seconds.

Yeah...i was hoping to expand on the project later (and learn a little bit now)


Fair enough! :smiley:

The schematic above looks fairly simple; can anyone break it down from pin to pin for me ?

for instance there are somethings on here that aren't labeled:

What isn't labeled then?

The two caps?

Edit oops, battery and cap.

The OCL version looks like it only uses the 104 Cap... whats the difference? OCL or low res?

I think the OCL will work for my needs. Thoughts?

where do i find the pinout for the SD card?

found this:

where do i find the pinout for the SD card?

On the picture you posted?

like it only uses the 104 Cap

That is a 0.1uF ceramic cap for supply decoupling.
Can you guess what the battery voltage is?

Grumpy Mike you're hilarious! Sometimes humor doesn't translate well to black and white, but LOL!

im assuming the 0.1uF capacitor is a 104 disc cap, and the voltage is 3.3V as denoted by the bold "3.3V" on the schematic.

I was going to use a 3V Lithion coin cell. what do you think?

Also, going through various tutorials, i see that the at tiny will loop through the wav files on the card while power is on....

what about pressing a button to play a file?

So, the project is a box my wife will keep on her desk. when she presses the button the audio file should play. But I was thinking is it possible (to save battery) that the audio only plays when she presses the button? In theory: turns on the circuit plays and turns off the circuit? How do those hallmark cards work? are they always on?


I made this "translator" for last year's maker fair in Rome, people often ask the same questions and some one on the forum translated and recorded my answers. I looked up what number answer and pressed the buttons corresponding to that answer.
I know it is a bit more than you want but I am sure you can pick the bones out of it.


Schematic and software attached.

Translator Schematic.pdf (121 KB)

Translator.ino (5.7 KB)

thank you mike... ill take a look!

i noticed you have an on switch. is it possible that the num pad can turn on the circuit (maybe with a timer) turn it of (maybe with a relay or something - i have a 6 pin digital relay)