Microsoft DirectX 8.0 (C++) |
The compression/decompression (codec) algorithms provided specifically with Microsoft® DirectPlay® are voice-quality codecs. They are all 8 kHz, 16-bit mono-format–based algorithms. Third-party codecs are not supported, and you cannot write proprietary codecs for use with DirectPlay Voice.
It is important to note that as the bandwidth requirements drop, the audio quality of the voice data also drops. The following table describes the sound quality of each codec.
Codecs cannot be dynamically switched during a game voice session, and all users must use the same codec in a voice session. However, a game could possibly create an appropriate user interface to force codec switching by dropping a current session and creating a new session using a different codec. This would be appropriate if the game application's users were jumping from a lobby chat to a game.
As with all other game setup parameters, the host should control the codec used. The voice-session host does not necessarily have to be the same as the game-data host.
As with any form of network communication, it is important to analyze the cost of the voice communication to ensure that adequate bandwidth is available to support communication of the game data and voice data. Analyzing the voice bandwidth consumption is straightforward. Estimate the number of simultaneous voice streams that you anticipate and multiply that number by the sum of the bandwidth required by the codec and the protocol overhead.
CPU consumption is another factor to consider when choosing a codec. Even low bandwidth codecs typically require about 8 percent of a 200 megahertz (MHz) Pentium processor's resources to encode a voice stream and an additional 4 percent to decode. As with network bandwidth, CPU resource consumption is additive per stream.