I'm working on a synthesizer project and I'm confused on what the final audio output voltage should be. The idea is that I would send the audio to a speaker or headphone amplifier, so I don't have to drive a small load or anything. I've seen +-1.4V places, but when I tested that with my headphones it was really loud. Is that just the maximum volume? Also, would the voltage range be different if it were a keyboard amp instead? Any clarifications on this would be greatly appreciated.
Audio gear is genearally designed to have nominal levels of “-10dBV” (consumer) or “+4dBu” (professional).
-10dBV corresponds to 0.3Vrms and +4dBu to 1.2Vrms. But these are merely “nominal” levels. A certain amount of headroom, generally 12dB or more, is added to allow for the loudest signals to not clip.
But these are for the synthesizer outputs that go into an amplifier or another piece of gear.
If you’re driving headphones or speakers directly that’s a whole different story.
Low impedance headphones and earbuds (8-32 Ohms) need only a small voltage, under 1Vrms max but a fair amount of current, up to 100mA.
High impedance headphones (300-600 Ohms) need a high voltage (4-5V rms max) but only a few mA.
If your circuit has to drive a speaker then it'll need to deliver substantial current. More than an op-amp can deliver. A dedicated audio amplifier chip is the simplest answer. Texas Instruments (for one) have loads of possibilities.
You'll need to offer more detail if you want more info but speakers are usually 8 ohms impedance and the current standard for headphones is 32 ohms but in reality headphones may vary anywhere between 8 and 600 ohms and require different drive voltages.
If it's too loud using your headphones, then try using some other types for comparison and measure the voltage typically delivered. From that you should be able to determine a sensible level. If not already present, you may need to add a volume control using a potentiometer configured as a voltage divider in the signal path.
As in another answer, you may need to consider 2 output levels (consumer and 'pro'), although a volume control should suffice. Not knowing the sensitivity of a 'keyboard amp', it's hard to comment on this point but again a volume control should help.
when I tested that with my headphones it was really loud
You're asking about the levels that an audio amplifier needs to receive at its input, which are different from what headphones need.
Headphones are extremely efficient, like 95dB at 1 milliwatt. On 600 ohms headphones, 1 volt is already over 1mW, so more than 95dB which is really loud. And on lower impedance headphones it'll be even louder. So headphones aren't the proper tool here.
The "official" consumer line level is 0.3V RMS, just round that up to 0.5V peak.
No-one cares though, because a higher output voltage gives a bit better signal to noise ratio. So lots of consumer equipment goes way over 0.5V peak, sometimes up to 3V peak. When the source has higher output levels, turning down the volume pot on the amp will attenuate it to desired levels, and it will also attenuate any noise picked up along the way by the same amount. Signal to noise ratio is... a ratio.
Personally I'd use 2-2.5V peak to avoid clipping 3V3 opamps if you connect your gear to a cheap soundcard that uses those. As long as no part of the signal chain clips or distort, more voltage = better SNR.
If you want to add a headphone output to your synthetiser, make sure you put a volume pot there! And an output stage that can push enough current to drive low impedance headphones (ie, FOR THE LOVE OF GOD PLEASE don't use a TL072 or a 4558 opamp or anything that gives up at a couple mA, and make sure it's short circuit tolerant too).
But a volume pot on the line output is not necessary if you feed it into a mixing desk or amp which has volume control anyway.
There is no one true value, and unfortunately, all three output cases of line level, headphone level, and speaker level have different voltage levels and driving requirements. The volume level should of course be adjustable, as it depends a lot if you are playing a single audio channel quietly or loud, or playing multiple audio channels at the same time, during a quiet part or loud part. So there should be a volume control to allow for variation how large amplitude to output depending on how you are playing, and depending on what is the sensitivity of the input where the audio is fed.
Line level output from modern DACs is 2 Vrms for full scale audio, which equals +/- 2.83 V or 5.66 Vpp. That should be the approximate maximum level at full volume. Typically, if you had a Hi-Fi set with separate components, some devices such as CD players have had somewhat higher voltage levels than other devices like FM tuners. So this applies to RCA and 3.5mm TRS connectors. Not much current goes into a line input, the input impedance is generally much more than 10kohms, and output impedance is lower than 1kohm.
Headphone output is based on the sensitivity and impedance. The sensitivity means what is the audio output level in dB SPL when fed with 1 milliwatt of power, while sometimes it is rated with dB SPL at 1Vrms voltage for marketing reasons as the number is larger. Anyway, typical sensitivities are in 90-120 dB/Vrms, so 1Vrms signal to headphones is really loud. So +/- 1.414V should be plenty. Moderate current is needed, as headphones are between 8 and 600 ohms, so up to about 125mA drive ability might be necessary.
Speaker output is also based on sensitivity and impedance. With speakers, the sensitivity is measured with dB SPL at 1 meter when fed with 1W of power. As typical speaker can output between 80-90 dB/W, so again 1 Watt is really loud. To push 1W into 16 ohms, 4Vrms is needed, and to push 1W into 4 ohms, current drive ability of 0.5A is needed.