Preferencial swapping of audio inputs

Looking into creating a new project that relies on having two audio inputs and a single output. Very new to arduino but eager to learn if it is possible to play audio from one input, and upon detecting a signal on the second input prefer to output that.

aka, input 1 to output 1 until signal detected on input 2 then output input 2.

Any tips or guides regarding negative voltages and outputting a whole signal to a speaker would be fantastic, but there are several great guides just dedicated to audio signals.

Would it be OK if the audio signal doesn't pass-through the Arduino? The Arduino doesn't have a proper DAC (digital-to-analog comverter) built-in, the ADC is only 10-bits, and there may be sample-rate limitations. (And, you cannot directly drive an 8-Ohm speaker without an amplifier.)

If you just want to switch the signals, you can detect the 2nd signal with an analog input (with the threshold software-adjustable), and then switch the signal path with a relay (use a DPDT relay for stereo).

Any tips or guides regarding negative voltages and outputting a whole signal to a speaker would be fantastic, but there are several great guides just dedicated to audio signals.

The standard approach is to bias the input at 5V (2 equal-value resistors and a capacitor), and then filter-out the bias from the output with a capacitor.

If you just need to detect the signal and it's OK to ignore the negative half-cycle, you can use a pair of [u]protection diodes[/u] and a resistor (2nd figure). For line-level signals, change the resistor to 10K or more. For a speaker-signal, 1K should be good. You'll also need a "pull down" resistor between the Arduino's analog input and ground. That resistor should be at least 10 times the series resistor value.

It would be wonderful if it could skip the arduino, seems like a lot more complexity than needed. I looked into the relay you suggested and it seems to suit my purpose. The end result will see a music input (ipod jack, smartphone, etc) and a radio walkie talkie as the two switching inputs to the single output, play music until radio'd and then using arduino to detect that signal on input 2 swap the relay over to output that audio instead.

Thankyou for the additional reading on protection diodes also!