Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
DirectSound
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Software library for Windows operating system}} '''DirectSound''' is a deprecated software component of the [[Microsoft]] [[DirectX]] library for the [[Microsoft Windows|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 [[Miles Sound System|John Miles]].<ref name="maxpcevolution">{{cite journal |title=The Evolution of DirectX |journal=[[Maximum PC]] |date=October 1998 |volume=3 |issue=9 |page=B8 |url=https://books.google.com/books?id=7wEAAAAAMBAJ&pg=PT93 |access-date=July 21, 2019}}</ref> 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., [[Reverberation|reverb]], [[Echo (phenomenon)|echo]], or [[Flanging|flange]]), using hardware accelerated buffers (if the sound card supports hardware acceleration) in Windows 95 through XP, and [[3D audio effect|positioning sounds in 3D space]]. DirectSound also provides a means to capture sounds from a microphone or other input and controlling capture effects during audio capture.<ref>[http://msdn.microsoft.com/en-us/library/windows/hardware/ff536327(v=vs.85).aspx DirectSound Capture Effects: MSDN]</ref> 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 [[video game]]s, 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.<ref>[http://msdn.microsoft.com/en-us/library/windows/desktop/dd375463(v=vs.85).aspx DirectShow FAQ]</ref> ==Features== DirectSound is a [[user mode]] API that provides an interface between [[application software|applications]] and the [[sound card]] driver, enabling applications to produce sounds and play back music. 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 [[sample rate conversion]] and [[Audio mixing (recorded music)|sound mixing]] ([[loudness|volume]] and [[Panning (audio)|pan]]) 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 "[[sample-based synthesis|wavetable]]" sound cards such as [[Sound Blaster AWE32]] and [[Gravis Ultrasound]] featured dedicated [[Digital signal processor|DSPs]], which were borrowed from the [[digital synthesizer|digital music instruments]]. These cards featured local memory which could be used for buffering multiple audio streams and mixing them on board, thus offloading the CPU and greatly improving the sound quality. However, this was only possible in DOS by directly programming the hardware, and full-featured "hardware acceleration" from the local memory was never implemented on these cards, due to complexities of [[double buffering]]. Later cards such as [[Sound Blaster Live!]], Audigy and X-Fi are capable of accessing the system memory buffers directly. ==DirectSound3D== '''DirectSound3D''' (DS3D) is an extension to DirectSound introduced with DirectX 3 in 1996 with the intention to standardize [[3D audio effect|3D audio]] in Windows. DirectSound3D allows software developers to utilize audio by writing once for a single audio [[Application programming interface|API]] instead of rewriting code numerous times to work for each audio card vendor. In DirectX 5, DirectSound3D gained the support for sound cards that use third party 3D audio algorithms in order to [[Hardware acceleration|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== {{main|Environmental Audio Extensions}} EAX is an extension to DirectSound and DirectSound3D which provides sound effects processing to the hardware-accelerated buffers. ==OS Support== ===Windows 9x=== In Windows 95, 98 and Me, the DirectSound mixer component and the sound card drivers were both implemented as a [[kernel-mode]] [[VxD]] driver (Dsound.vxd), allowing direct access to the primary buffer used by the audio hardware and thus, providing the lowest possible latency between the user-mode API and the underlying hardware, but in some cases causing instability and [[Blue Screen of Death|blue screen]] errors. Windows 98 introduced WDM Audio and the ''Kernel Audio Mixer'' driver ([[KMixer]]), which enabled digital mixing, routing and processing of simultaneous audio streams with a higher quality sample rate conversion as well as kernel streaming. Under WDM, DirectSound sends data to the software-based KMixer. Windows 98 Second Edition improved WDM audio support by adding DirectSound hardware buffering, DirectSound3D hardware abstraction, KMixer sample-rate conversion (SRC) for capture streams, multichannel audio support and introduction of [[DirectMusic]]. If the audio hardware supports [[hardware mixing]] (also known as hardware buffering or DirectSound hardware acceleration), DirectSound buffers directly to the rendering device.<ref>[http://msdn.microsoft.com/en-us/library/windows/desktop/ee416769(v=vs.85).aspx DirectSound Driver Models]</ref> If DirectSound streams use hardware mixing, KMixer and its latency delay are bypassed.<ref>[http://msdn.microsoft.com/en-us/library/windows/hardware/ff537603(v=vs.85).aspx Overview of DirectSound Hardware Acceleration]</ref> On Windows 98 and Windows Me, WDM audio drivers were preferred but compatibility with VxD driver model was preserved. 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 NT]] by introducing the WDM audio drivers and the kernel mixer component ([[KMixer]]).<ref name=CakeWalkKS>[http://www.cakewalk.com/DevXchange/article.aspx?aid=114 CakeWalk - Windows Pro Audio Roundtable]</ref> In Windows XP, Microsoft introduced another improved kernel streaming class driver, ''AVStream''. Beginning with Windows XP, hardware acceleration was also added for DirectSound capture effects processing<ref>[http://msdn.microsoft.com/en-us/library/ff536379(v=vs.85).aspx Exposing Hardware-Accelerated Capture Effects]</ref> such as [[Echo cancellation#Acoustic echo cancellation|Acoustic Echo Cancellation]] for USB microphones, noise suppression and array microphone support. ===Windows Vista/Windows 7=== Windows Vista features a completely re-written audio stack based on the ''[[Universal Audio Architecture]]''. Because of the architectural changes in the redesigned audio stack, a direct path from DirectSound to the audio drivers does not exist.<ref>{{cite web |url=http://techreport.com/articles.x/13874 |title=Techreport article on Vista-ready soundcards |date=15 January 2008 |access-date=2008-12-23}}</ref> DirectSound, [[DirectMusic]] and other APIs such as [[MultiMedia Extensions|MME]] are emulated as [[Technical features new to Windows Vista#Audio stack architecture|WASAPI]] Session instances. DirectSound runs in emulation mode on the Microsoft software mixer. The emulator does not have hardware abstraction, so there is no hardware DirectSound acceleration, meaning hardware and software relying on DirectSound acceleration may have degraded performance. It's likely a supposed performance hit might not be noticeable, depending on the application and actual system hardware. In the case of hardware [[3D audio effect]]s played using DirectSound3D, they will not be playable; this also breaks compatibility with EAX extensions.<ref name=creativeKB25937>[http://support.creative.com/kb/ShowArticle.aspx?sid=25937 Creative Technology - Support - Audio in Windows Vista]</ref> Third-party APIs such as [[Audio Stream Input/Output|ASIO]] and [[OpenAL]] are not affected by these architectural changes in Windows Vista, as they use [[ioctl|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.<ref>{{cite web |url=http://www.openal.org/openal_vista.html |title=OpenAL and Windows Vista |access-date=2008-01-10 |url-status=dead |archive-url=https://web.archive.org/web/20080102032457/http://www.openal.org/openal_vista.html |archive-date=2008-01-02 }}</ref> ===Windows 8=== [[WASAPI]] audio stack in [[Windows 8]] introduces support for "hardware offloading" of multiple audio streams to the audio card for mixing and effect processing, in addition to the software processing introduced in Vista,<ref name=offloadingW8>[http://msdn.microsoft.com/en-us/library/windows/hardware/br259116 Audio Offloading: Exposing Hardware-Offloaded Audio Processing in Windows]</ref><ref name=WDK_w8>[http://msdn.microsoft.com/en-us/library/windows/hardware/hh439707 Windows Driver Kit - Windows Developer Preview - New for Audio Drivers]</ref> however the functionality is only exposed for [[Windows Runtime]] apps.<ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/windows/hardware/dn265105(v=vs.85).aspx |title = Implementation Overview - Windows drivers {{!}} Microsoft Docs}}</ref> DirectSound's and [[DirectMusic]]'s hardware interfaces to sound card drivers are not implemented. ===Windows 10=== [[Windows 10]] support [[computation offloading|hardware offloading]] of [[Sound effect (musical instruments)|sound effects]].<ref>{{cite web |url=https://learn.microsoft.com/en-us/windows-hardware/drivers/audio/windows-threshold--what-s-new-for-audio |title=Windows 10: What's New for Audio Drivers |website=Microsoft |date=December 15, 2021}}</ref><ref>{{cite web |url=https://learn.microsoft.com/en-us/windows-hardware/drivers/audio/audio-processing-object-architecture |title=Audio Processing Object Architecture |date=December 13, 2024 |website=Microsoft}}</ref> ===Windows CE=== Although DirectSound support was available in [[Windows CE]] versions up to 4.2, it was removed starting 5.0.<ref>[http://msdn2.microsoft.com/en-us/library/aa446919.aspx Windows CE 5.0 removed functionality]</ref> Windows CE 6.0 also does not support DirectSound, instead favoring that applications be rewritten to use the Waveform Audio API. == 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.<ref>{{cite web |url=http://www.soundblaster.com/alchemy/ |title=Creative ALchemy website |access-date=2008-12-23 |url-status=dead |archive-url=https://web.archive.org/web/20081217081648/http://www.soundblaster.com/alchemy/ |archive-date=2008-12-17 }}</ref> 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 [[Intel High Definition Audio|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.<ref>[https://www.indirectsound.com/ IndirectSound]</ref> 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.<ref>{{cite web |title=DSOAL: A DirectSound DLL replacer that enables surround sound, HRTF, and EAX support via OpenAL Soft |url=https://github.com/kcat/dsoal |website=GitHub |date=20 April 2023}}</ref> == Upper limit of sampling rate == The maximum [[Sampling rate]] that DirectSound can handle is 200 kHz,<ref>[https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee419022(v=vs.85) What's New in DirectSound]</ref> and if Windows is set to a sampling rate above 192kHz, e.g. 384kHz which is supported by sound devices such as USB-DACs, applications that handle directsound (such as old games created before the 2010s) may not start, or if they do start, they may not output any sound at all. To resolve this, set the sampling rate to 192 kHz or lower and it will work correctly. Applications that use XAudio2, [[WASAPI]], or [[ASIO]] instead of DirectSound can still operate at 384 kHz. == See also == *[[DirectMusic]] *[[OpenAL]] *[[Advanced Linux Sound Architecture]] *[[Technical features new to Windows Vista#Audio|Windows Vista audio architecture]] *[[Windows legacy audio components]] *[[Cross-platform Audio Creation Tool]] *[[XAudio2]] ==References== {{reflist}} == External links == *[http://msdn.microsoft.com/en-us/library/ee416960(v=VS.85).aspx MSDN DirectSound] *[https://web.archive.org/web/20070807002445/http://www.gamedev.net/reference/articles/article593.asp What's the deal with 3D sound under DirectX] *[https://web.archive.org/web/20070208072610/http://forums.creative.com/creativelabs/board/message?board.id=Vista&message.id=1694 Audio in Windows Vista] *[https://web.archive.org/web/20130602090219/http://connect.creativelabs.com/alchemy/ALchemy/Home.aspx Creative ALchemy] {on the Internet Archive} * [https://www.pcgamingwiki.com/wiki/Glossary:Sound_card Glossary:Sound card] on PC Gaming Wiki, with notes on DirectSound replacements {{Microsoft APIs}} {{DEFAULTSORT:Directsound}} [[Category:Application programming interfaces]] [[Category:Audio libraries]] [[Category:DirectX|Sound DirectSound]] [[Category:Music software plugin architectures]] [[Category:Windows audio]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Main
(
edit
)
Template:Microsoft APIs
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)