There is an application known as "Virtual Audio Cable" that might allow you to achieve the desired goal.
It allows the creation of virtual input and output interfaces which can then be mapped to physical audio inputs and outputs on the computer.
Unfortunately, some sound card drivers are so designed that if you were to plug a set of headphones into the output jack, the speakers are then bypassed/disabled. If that is the case, then your only recourse would be to have an additional soundsystem attached via HDMI, or via USB sound card, allowing you to choose between the headphones on the computer or the speakers on the external device.