Setting up a speaker

I'm a beginner with the arudino and I'm still trying to wrap my head around how to set up a speaker with the Due. Is there a specific breadboard configuration or parts I have to buy? Some solutions I've seen recommend parts that aren't available on the market.

I'm trying to follow this example: https://www.arduino.cc/en/Tutorial/DueSimpleWaveformGenerator

Thank you for reading through this, I look forward to your answers.

Due only outputs 0-3V signal. Get yourself a pair of powered computer speakers, they have amplifier built in. I use a pair of old Gateway 2000 speakers, they sound great! Connect your due output thru a 10uF electrolytic cap to the speaker input.

A DUE project with a speaker:

https://create.arduino.cc/projecthub/msb4180/speech-recognition-and-synthesis-with-arduino-2f0363

And another one:

http://www.thingiverse.com/thing:1001442

CrossRoads: Due only outputs 0-3V signal. Get yourself a pair of powered computer speakers, they have amplifier built in. I use a pair of old Gateway 2000 speakers, they sound great! Connect your due output thru a 10uF electrolytic cap to the speaker input.

Can you give an example of this connection and what type of capacity to use? I know very little to nothing about creating new breadboard connections.

Also, would this shield work for the example I mentioned above that creates waveforms on its own, without files? https://www.adafruit.com/product/94

No, that shield will not play sounds your sketch creates.

Get a stereo jack that the speaker wire can plug into, or cut the end off and add some pins that can plug into the Arduino female headers.
Scroll down to the 3.5mm jacks here

Connect with 1K resistor and 10uF cap.
Audio connection.jpg

Hey again! We've gone quite far with the project, enough to load a sample of an actual sound into the software, but we're a bit confused with the audio quality.

We're getting this horrendous sound out our DAC. We've resisted and capactized the output, but still to the same effect. Different headphones, same effect.

Starting Sample Sound: http://freewavesamples.com/1980s-casio-violin-c5 Result from Speakers: https://instaud.io/XOM (Sorry for the weird site, I'm not sure where else to upload it)

We're using a simple TRRS breakout with Tip, Ring 1 and Sleeve soldered to wires that connect to DAC0, DAC1, and Ground respectively. Something interesting to note is that disconnecting ground doesn't do much.

If you'd like to view it, the code is up on github: https://github.com/Beeper-Weepers/Vuision/blob/master/instrument_main/waveform.h The software isn't the exact same as the one used to create the sound, though, I modified it a bit to continuously play the sample through it's list size. Not much different other than that.

Image of wiring setup: http://imgur.com/a/r1UeF

Thanks for your help!

Outputing correctly a sound is (IMO) a complex task because the frequency of the output has to match the exact sampling rate of the music (22Khz seems a minimum).

You might be interested by this: https://www.arduino.cc/en/Tutorial/SimpleAudioPlayer

My understanding of this kind of project:

An intensive use of DMA is necessary to make really several things at the same time, storing in SRAM parts of a pre-recorded music file, and in the same time outputing at the right frequency a previously stored part of the music to a DAC. See also https://www.sparkfun.com/tutorials/160

Ah man, this looks pretty complicated. Could I use the Audio library to solve this problem? With all the variables I modify? There doesn't seem to be any way to change frequency without calling AudioBegin. If not, are there other specific solutions? Each cycle of the loop takes around 16 milliseconds, so I assume that's where the issues are coming into play, because we're only playing at a rate of 62.5 Hz?