Ok but how do I know the amplifier provides enough resistance? Assuming that you don't add a resistor because everyone seems to just connect the amp directly.
The amplifier takes care of it. Audio power amplifiers and powered computer speakers typically have in input impedance of 10K to 100K so that's WAY over the minimum.
But, the GPD2846A isn't "just" an amplifier... Still no problem making the digital connections to the GPD2846A.
The description only talks about maximum output power at specified voltage (so basically I don't understand at which point the current is controlled)?
The actual voltage out of the amplifier is determined by the signal and the gain of the amplifier... During silence there is no (AC) voltage. When the signal (or digital data) is "loud" the voltage is higher. Of course, this also depends on the volume control setting. The *current flow *depends on the voltage and the speaker impedance. (Ohm's Law again.)
Most "things" are what we call "constant voltage". The doesn't always really mean the voltage is constant, but it's independent of the load. If we play a constant test-tone out of the amplifier it will put-out (about) the same voltage with a 4-Ohms speaker or an 8-Ohm speaker or with no speaker (infinite resistance). And again the current depends on the impedance. (No current with nothing connected.) If we connect a 2-Ohm load (like two 4-Ohm speakers in parallel) and the amplifier isn't rated down to 2-Ohms we could get excess current and fry the amplifier.
I thought the arduino provides 5V DC... doesn't that need to be converted somewhere?
The amplifier takes care of that too... There are several ways of handling that. If you have an amplifier with a single-positive supply the output can swing approximately the power supply voltage and ground. The output from the transistors or MOSFETs rests at half the power supply voltage when there is silence. So far... That's no good because we'd be sending DC to the speaker. But that's easy to fix with a capacitor in series with the output (which is built-into the amplifier circuit). Capacitors in series block the "DC component" while passing the AC through so instead of swinging from +5V to ground, it swings from -2.5V to +2.5V.
If you ever connect a regular amplifier or regular powered computer speakers to an Arduino output pin, it's a good idea to put a capacitor in series to keep the DC out of the amplifier. Most amplifiers have a capacitor on the input too, but if you don't know it's best to add one.
A bridge amplifier with a single power supply has half the power supply voltage on both speaker terminals. With the same voltage on both terminals the speaker doesn't "see" and voltage "across" it, and no DC current flows.
Some amplifiers (I think most headphone amplifiers in cell phones) have a "virtual ground" where the "ground" connection to the speakers/headphones isn't really ground. It rests at half the supply voltage (so no DC current flows). You can't use a bridge amplifier with headphones because the left & right share a common "ground" connection. The advantage of the virtual ground is that it eliminates the physically-large capacitor.
Most home hi-fi amplifiers have positive & negative power supplies so the output can rest at zero and it can swing positive and negative.
So any configuration of voltage and current is fine for the speaker as long as the recommended power isn't exceeded?
Right. Amplifiers are rated by power so usually we just want to make sure the amplifier power doesn't exceed the speaker power. Most of the time we don't have to think about voltage or current because most of the time the power supply is built-into the amplifier. If you are using an amplifier board you have to make sure you don't exceed the rated voltage for the amplifier and you need to know that lower voltage to the amplifier means lower power to the speakers. The power supply also has to be capable of supplying the required current when the amplifier is turned-up.