bit stream / bit bash low quality audio out single pin?

Sorry for a noob first post, but i have only had my kit 2 days and i need to make a simple voice out routine, its as simple as pressing a button with one on it and the word 'one' is spoken.

can i do this without any extra hw shield add ons, i can add a sdcard for audio storage, i'm using the 2560r3
in total its no more than 30(20?) seconds of audio in small clips
quality doesnt have to be great, 'robotic' would no doubt add to its appeal!

can i do this without any extra hw shield add ons,

It depends on what you call add ons. You need some sort of low pass filter, some times called a reconstruction filter, it can be as simple as a resistor and capacitor. Then you need to change the PWM frequency to something high and you then feed your samples into the PWM. You an only do this for 8 bit samples. You need an SD card reader circuit as well, is this not an add on?

Add a simple to control MP3 player card. Record your various sounds as seperate files, send a simple serial message to the card have it played back.
http://www.mdfly.com/index.php?main_page=product_info&cPath=9_53&products_id=284

Thanks for the replies, only just noticed i had some it seems the forum didnt email me as a ''watched topic''

I was hoping to get maybe 15 seconds of dalek speech without adding too much in the way of extras, I suppose i can push the boat out to the expense of an sdcard&socket...

Imagine a talking door lock, so spoken output like ''door locked'' . ''door unlocked'' / ''door open''

I can save space by reusing the ''door'' sample and the ''locked'' sample

Is the onboard dac not going to be of use?

if not i guess i can easily spare 2/3 pins to get some audio out just trying to keep complexity down but i know that will be at the expense of audio quality, but i'm not playing back Beethoven's 5th!

this is my first month with an arduino so i suppose i am trying to run before i can walk, and i have not had the hours to put in playing with it as i have car failures and ''work'' issues.

once I get some time to play I wont need as much spoon feeidng lol as i come from a pic background just ''jumped ship'' as I like the easier plug and play approach to development the arduino offers which makes for quite fast prototyping

I just had a google and an eBay, yes theres HW solutions, but lets face it some of them cost more than the arduino, I'm sure this chip is powerful enough to do it with just an sd card and maybe 4 pins to make a 4bit a/d output.

I have seen a youtube vid of one playing a 3 second sample in 8 bit with a simple R/2R resistor dac, thats perfect for my needs and 4 bits would do for voice... just dont have a clue how to get the correct sample from the sd card to the 'dac'

Is the onboard dac not going to be of use?

What onboard dac. TheDue is the only arduino with a built in dac.

Look at the wave shield's software for how to pluck samples out of an SD card. Rewrite the interrupt service routine that bit bangs the shieald's SPI dac to output to whatever dac you decide to attach to your system,

flez1966:
Is the onboard dac not going to be of use?

Arduino provides an ADC, not a DAC.

The ADC is used on the analog input pins to allow analog readings from a digital processor.
PWM pins are your option for "pseudo analogic output": you can generate square waves at specific on/off ratio and custom frequencies.

If you go for frequency controlled PWM consider using pin 9 and 10 only as changing other pin frequencies might disrupt system timing Arduino Playground - HomePage.

Maybe look at the SimpleSDAudio library?

uses PWM for audio output.. reads a 'file' (cant recall the format,.... .asf perhaps?) from the SD card... and plays it back through 1 (PWM) pin.. pin 9 I believe it is...

however that is the barebones... not sure if that will be LOUD enough for you with any sort of amp?

I used it for a very generic/minimal spiderman webshooter pcb/project.. where space was EXTREMELY limited...
worked fine.. but not very loud (although loud enough for that purpose) :slight_smile: