In theory yes but some hardware is better than others at autodetecting things. My soundcard for instance has to be manually switched from speaker to headphones.
Going with two separate devices (as you're about to do) it might not switch automatically. You may need to create a shortcut to your sound settings on your desktop.
If you happen to be running Windows 7 or 10 you can also right click on the speaker icon in the taskbar and access the sound settings.
Have you considered USB speakers with a headphone port?