These environment variables can be used on FreeBSD to enable diverse input and output audio devices with the base FreeBSD system (I couldn't get ALSA working). It's not necessarily possible to make a proper /dev/dsp device that works well on FreeBSD and the audio drivers don't permit choosing a different device based upon opening it as read-only or write-only.
I've gotten good use out of Android running on VirtualBox and using /dev/dsp1 for the laptop microphone input and /dev/dsp2 for my HDMI TV audio output. I couldn't really figure out any good way to do it without modifying something.