Go Down

Topic: Saving a short wav file to Attiny85 via the sketch/memory? (Read 8136 times) previous topic - next topic

rcpilotp51

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 https://www.sparkfun.com/products/11801 and the Arduino IDE. I don't know much about hex files or fuses.


Can anyone help?




AWOL

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.

Grumpy_Mike

Quote
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.

Quote
An sd card seems like a waste for one file.

Welcome to the real world.

JChristensen

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.

rcpilotp51

Thanks guys:

http://elm-chan.org/works/sd8p/report.html

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

Keith

JChristensen

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.

rcpilotp51


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)

Keith

JChristensen


rcpilotp51

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

rcpilotp51

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

http://elm-chan.org/works/sd8p/rc/sd8p_mo.png

Grumpy_Mike


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

http://elm-chan.org/works/sd8p/rc/sd8p_mo.png

What isn't labeled then?

AWOL

#11
Aug 04, 2014, 08:30 pm Last Edit: Aug 04, 2014, 08:32 pm by AWOL Reason: 1
The two caps?

Edit  oops, battery and cap.

rcpilotp51

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?

rcpilotp51

found this:

https://my.st.com/public/STe2ecommunities/ImageLibrary/SD%20card%20pinout.jpg

Grumpy_Mike

Quote
where do i find the pinout for the SD card?

On the picture you posted?

Quote
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?

Go Up