How is it possible for a single PC soundcard, which I assume only have one DAC (Digital to Analog Converter) to process multiple digital inputs and route the analog outputs to different devices?
For example, using Spotify and Youtube, how do soundcards can, at the same time, send Spotify output to your headset (plugged via headphone jack) and Youtube output to your speaker?
It seems possible on every Operating System and some software appear limitless: i.e. they seem to be able to map any inputs to any outputs. See for example Audio Router or Is it possible to have two sources of audio output to different speakers in Windows 10?
I'm looking for low level explanations. Is it handled by the soundcard's electric component? by the soundcard's drivers?
I can conceptually visualize how one could mix inputs together to produce a single merged analog signal (i.e. play two songs at the time), or how one can stream a specific analog signal to multiple devices (i.e. play a song on your speaker and headset). But how would one DAC handle two inputs in parallel without running into sound quality issues? How does it scale to N inputs/outputs?
PS: I'm NOT talking about sending the digital output to a device with its own DAC, but more precisely producing two analog outputs.