DirectSound
DirectSound is a deprecated software component of the Microsoft DirectX library for the Windows operating system, superseded by XAudio2. It provides a low-latency interface to sound card drivers written for Windows 95 through Windows XP and can handle the mixing and recording of multiple audio streams. DirectSound was originally written for Microsoft by John Miles.[1]
Besides providing the essential service of passing audio data to the sound card, DirectSound provides other essential capabilities such as recording and mixing sound, adding effects to sound (e.g.,
After many years of development, today DirectSound is a mature API, and supplies many other useful capabilities, such as the ability to play multichannel sounds at high resolution. While DirectSound was designed to be used by games, today it is used to play audio in many audio applications. DirectShow uses DirectSound's hardware audio acceleration capabilities if the sound card's hardware audio acceleration capabilities exist and are exposed by the audio driver.[3]
Features
DirectSound is a
DirectSound was considered revolutionary when it was introduced in 1995, as it featured multiple simultaneous audio streams and allowed several applications to access the sound card simultaneously. Before that, the game developers were required to implement their own audio rendering engine in software.
DirectSound provides
) for an unlimited number of audio sources; however, the practical limits are the number of hardware audio sources and the performance of software mixers.The DirectSound architecture features a concept of the "ring buffer" which would be continuously played in a cycle. The application programmer creates the sound buffer then continuously queries its state through the "read cursor" and updates it with the "write cursor". There are two types of buffers - a "streaming" buffer, which holds continuous sounds such as background music, and a "static" buffer which holds short sounds.
On supported sound cards, DirectSound would try to use "hardware accelerated" buffers, i.e. the ones which either can be placed in local sound card memory, or can be accessed by the sound card from the system memory. If hardware acceleration is not available, DirectSound would create audio buffers in the system memory and use purely software mixing.
Some late DOS-era "
DirectSound3D
DirectSound3D (DS3D) is an extension to DirectSound introduced with DirectX 3 in 1996 with the intention to standardize
In DirectX 5, DirectSound3D gained the support for sound cards that use third party 3D audio algorithms in order to accelerate DirectSound3D properly, through methods approved by Microsoft.
In DirectX 8, DirectSound and DirectSound3D (DS3D) were officially merged and given the name DirectX Audio, however the API is still commonly referred to as DirectSound.
EAX
EAX is an extension to DirectSound and DirectSound3D which provides sound effects processing to the hardware-accelerated buffers.
OS Support
Windows 95
In Windows 95, 98 and Me, the DirectSound mixer component and the sound card drivers were both implemented as a
Windows 98 introduced WDM Audio and the Kernel Audio Mixer driver (
Although Windows Driver Model (WDM) was available starting with Windows 98, few audio card manufacturers used it. Due to internal buffering, KMixer introduced significant processing latency (30 ms on then-current systems). Windows 98 also includes a WDM streaming class driver (Stream.sys) to address these real time multimedia data stream processing requirements. When the sound card uses a custom driver for use with the system supplied port class driver PortCls.sys or implements a mini-driver for use with the streaming class driver, applications can bypass the KMixer completely and use the kernel streaming interfaces instead to reduce latency.
Windows 2000/XP
In Windows 2000, Microsoft also implemented the same WDM-based audio stack on
Windows Vista/Windows 7
Windows Vista features a completely re-written audio stack based on the
Third-party APIs such as ASIO and OpenAL are not affected by these architectural changes in Windows Vista, as they use IOCtl to interface directly with the audio driver. A solution for applications that wish to take advantage of hardware accelerated high-quality 3D positional audio is to use OpenAL. However, this only works if the manufacturer provides an OpenAL driver for their hardware.[10]
Windows 8
Windows CE
Although DirectSound support was available in
Replacement implementations
After the removal of DirectSound in Windows Vista, a few replacement implementations have appeared.
Sound Blaster's Creative ALchemy (2007) provides hardware acceleration of DirectSound3D and Audio Effects, such as EAX.[15] Creative ALchemy intercepts calls to DirectSound3D and translates them into OpenAL calls to be processed by supported hardware such as Sound Blaster X-Fi and Sound Blaster Audigy. For software-based Creative audio solutions, ALchemy utilizes its built-in 3D audio engine without using OpenAL at all.
Realtek, a manufacturer of integrated HD audio codecs, has a product similar to ALchemy called 3D SoundBack. C-Media, a manufacturer of PC sound card chipsets, also has a solution called Xear3D EX, although it works instead by intercepting DirectSound3D calls transparently in the background without any user intervention.
IndirectSound is a freeware library that emulates DirectSound 3D using XAudio2, without using hardware acceleration.[16]
DSOAL is an open source library that emulates DirectSound 3D and EAX using OpenAL. Either a hardware-accelerated OpenAL implementation or OpenAL Soft (which provides HRTF) can be used.[17]
See also
- DirectMusic
- OpenAL
- Advanced Linux Sound Architecture
- Windows Vista audio architecture
- Windows legacy audio components
- DirectX plugin
- Cross-platform Audio Creation Tool
- XAudio2
References
- ^ "The Evolution of DirectX". Maximum PC. 3 (9): B8. October 1998. Retrieved July 21, 2019.
- ^ DirectSound Capture Effects: MSDN
- ^ DirectShow FAQ
- ^ DirectSound Driver Models
- ^ Overview of DirectSound Hardware Acceleration
- ^ CakeWalk - Windows Pro Audio Roundtable
- ^ Exposing Hardware-Accelerated Capture Effects
- ^ "Techreport article on Vista-ready soundcards". 15 January 2008. Retrieved 2008-12-23.
- ^ Creative Technology - Support - Audio in Windows Vista
- ^ "OpenAL and Windows Vista". Archived from the original on 2008-01-02. Retrieved 2008-01-10.
- ^ Audio Offloading: Exposing Hardware-Offloaded Audio Processing in Windows
- ^ Windows Driver Kit - Windows Developer Preview - New for Audio Drivers
- ^ "Implementation Overview - Windows drivers | Microsoft Docs".
- ^ Windows CE 5.0 removed functionality
- ^ "Creative ALchemy website". Archived from the original on 2008-12-17. Retrieved 2008-12-23.
- ^ IndirectSound
- ^ "DSOAL: A DirectSound DLL replacer that enables surround sound, HRTF, and EAX support via OpenAL Soft". GitHub. 20 April 2023.
External links
- MSDN DirectSound
- What's the deal with 3D sound under DirectX
- Audio in Windows Vista
- Creative ALchemy {on the Internet Archive}
- Glossary:Sound card on PC Gaming Wiki, with notes on DirectSound replacements