That's going to be slightly more difficult then.
Onboard audio and optical output are treated as two separate audio devices by Windows and can only play one audio stream to the default audio device. To get two different audio devices to receive the same audio stream, means using separate software.
You need use something like Virtual Audio Cable. There are probably others, but VAC is the only one I have used.
Using VAC; it can be fiddly to setup if you are not used to how it works, but you do need to buy the software, otherwise a voice message that says 'trial' every so often, which is rather annoying.
A quick search shows there are free alternatives.