Discrete_BOB_058 wrote on 2020-12-31, 08:21:
Three of these APIs are components of DirectX libraries for sound while other is a older component introduced in Windows 3.0.
However I would like to know the differences between the 4 of these. I didn't get much documentation on the Internet on this topic. Can anybody explain to me the differences of these and which should I choose case by case, even though they are deprecated.
1. WinMM: Interestingly this is the most compatible one to this day. It works on all Windows versions up to Win 10 x64. Also this is the broadest and most feature rich since it includes:
a. Low level Wave In/Out functions.
b. ACM audio compression manager.
c. AVI video functions.
d. Low and Middle/High level Midi In/Out functions.
e. High level general media control interface (MCI) that can be used for CD audio.
f. High precision Multimedia timer functions.
g. Joystick related functions.
2. Directsound is only about low level digital audio. From Win9x up to WinXP you could use hardware accelerated audio buffers+ 3D positional audio + other proprietary extensions like A3D and EAX with it. It was intended to be a more close to metal approach to digital audio than WinMM that provides better efficiency and latency. This worked pretty well on Win 9x, somewhat on WinXP, but from Windows Vista it does not have any performance benefit over WinMM Wave In/Out functions.
3. DirestShow is mainly a high level API for handling different multimedia files (Audio +Video). It is based on different filters (plugins) that can be connected (like file source, decompressor/compressor, muxer/demuxer, etc.) to construct so called directshow graphs that can be used to play back existing files or encode new ones. It can also handle webcams, capture cards etc.
4. Directmusic is also a higher level API for handling game music based on Midi. Unfortunately this is the 'most deprecated' one. Some core functions of it have never been ported to 64bit Windows and never will be. It also supported DLS soundfonts (even embedded ones in riff Midi files). Unfortunately DLS soundfonts never became as popular as SF2 .
So despite it is a later API than WinMM Midi API it is less compatible with modern 64-bit Windows than the earlier one.
Since very few hardware supported Directmusic natively (AFAIK it is supported only by some drivers of Creative Labs) most users only could use the Microsoft soft synth with Directmusic software. Although Directmusic provided a wrapper around standard Midi ports these wrapped ports did not support advanced features like handling DLS soundfonts.