Unlike displays that eventually converged to (S) VGA, sound cards never achieved the same compatibility. There were different Sound Blaster, Gravis Ultrasound and others. Nowadays, modern equipment is often incompatible with those, and you cannot program them in DOS as Sound Blaster, without having the proper DOS driver or without knowing the supported memory areas, ports, formats and protocols.
I can only offer such a program for a PC / DOS emulator, such as DosBox, which emulates Sound Blaster and (S) VGA. That should work.
Alternatively, you can simply write a regular Windows program using the Win32 API for input, drawing and sound.
source share