An introduction to computer audio
Windows 7 audio architecture
There are no major changes in the audio architecture of Win 7 compared with Vista.
New in Win 7 according to Microsoft:
- In Windows 7 share mode streams run in low-latency
mode. The audio engine runs in pull mode with a significant reduction
in latency. This is very useful for communication applications that
require low audio stream latency for faster streaming.
- Windows 7 provides better device role detection when a
new device is added to the system.
- In Windows 7 you can listen to music from your portable
media player through your computer speakers. You can use this Capture
Monitor feature by plugging a portable media player into your computer
with an analog audio cable.
- HDMI audio has been enhanced in Windows 7, which provides
support for high-bit-rate format. With this improvement, you can support
multichannel audio and compressed audio formats over an HDMI connector
to an audio receiver.
- In Windows Vista, Windows Media Player plays music only
through the default audio device, which cannot be changed by the user.
For Windows Media Player to render audio to a particular device, the
default device must be changed in the Sounds control
panel. In Windows 7, Windows Media Player provides APIs that enable
an application to render to any device selected by the user and not just
the default device.
- In Windows Vista, if a computer that is playing audio switches
to the power-save mode, the computer is locked, and if the user wants
to interrupt the playback, the user must log on and press the stop key
to stop the playback. In Windows 7, if the computer is locked, you
can still control the playback by using the HID control on the keyboard.
- Windows 7 reduces power consumption for any application
that uses DirectSound and DirectShow to render media. In addition, the
Multimedia Class Scheduler Service enables glitch-resilient audio and
uses less power while the audio samples are being generated.
You can have multiple audio streams e.g. you have your music playing and another application kicks in, a system sound, a VOIP call, audio embedded in a web page, etc.
To play the streams simultaneously they must be mixed.
This is the task of the Windows audio engine.
The bit depth of the incoming streams is converted to 32 bit float.
The audio send to the audio driver is converted to a format the driver accepts (16 or 24 bits most of the time) and always dithered.
You can bypass the mixer by using WASAPI in exclusive mode.
As a sound card can only run at one sample rate, all streams must have the same sample rate.
Any stream not having the default sample rate as set in the Win audio panel, has to be converted before it is send to the mixer.
Another reason to apply sample rate conversion is a mismatch between the sample rate of the source and the sample rate(s) supported by the hard ware.
E.g. you play a CD but your sound card only supports 48 kHz (the cheap ones do); you downloaded some 24 bit/176 kHz recordings but your sound card supports 24 bit/96 kHz max.
Sample rate conversion must be done by the application sending audio to the mixer.
This can be the SRC as supplied by Win or one supplied by the application.
When you convert the sample rate of an audio file from one frequency to another frequency on a computer that is running Windows 7 or Windows Server 2008 R2, the new audio file sounds distorted during playback.
The audio file sounds distorted when you play it on any audio record, capture, or encoder application if the following conditions are true:
- The application uses the Multimedia Extensions (MME) Wave I/O API.
- The application relies on the Audio Resampler or an audio sample rate converter.
This issue occurs because the sample rate converter uses linear interpolation when it converts audio files. This behavior creates noise on the audio file that is sensitive to the human ear.
Audio file sounds distorted after you convert the sample rate in Windows 7 or in Windows Server 2008 R2 - Microsoft Support
User-Mode Audio Components - MSDN