2.2.2.2 Client Audio Formats and Version PDU (CLIENT_AUDIO_VERSION_AND_FORMATS)

The Client Audio Formats and Version PDU is a PDU that is used to send version information, capabilities, and a list of supported audio formats from the client to the server.<5> After the server sends its version and a list of supported audio formats to the client, the client sends back a Client Audio Formats and Version PDU to the server containing its version and a list of formats that both the client and server support. This PDU MUST be sent by using virtual channels.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Header

dwFlags

dwVolume

dwPitch

wDGramPort

wNumberOfFormats

cLastBlockConfirmed

wVersion

bPad

sndFormats (variable)

...

Header (4 bytes): An RDPSND PDU header (section 2.2.1). The msgType field of the RDPSND PDU header MUST be set to SNDC_FORMATS (0x07).

dwFlags (4 bytes): A 32-bit unsigned integer that specifies the general capability flags. The dwFlags field MUST be one or more of the following flags, combined with a bitwise OR operator.

Value

Meaning

TSSNDCAPS_ALIVE

0x00000001

The client is capable of consuming audio data. This flag MUST be set for audio data to be transferred.

TSSNDCAPS_VOLUME

0x00000002

The client is capable of applying a volume change to all the audio data that is received.

TSSNDCAPS_PITCH

0x00000004

The client is capable of applying a pitch change to all the audio data that is received.

dwVolume (4 bytes): A 32-bit unsigned integer. If the TSSNDCAPS_VOLUME flag is not set in the dwFlags field, the dwVolume field MUST be ignored. If the TSSNDCAPS_VOLUME flag is set in the dwFlags field, the dwVolume field specifies the initial volume of the audio stream. The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.

This value is to be interpreted logarithmically. This means that the perceived increase in volume is the same when increasing the volume level from 0x5000 to 0x6000 as it is from 0x4000 to 0x5000.

dwPitch (4 bytes): A 32-bit unsigned integer. If the TSSNDCAPS_PITCH flag is not set in the dwFlags field, the dwPitch field MUST be ignored. If the TSSNDCAPS_PITCH flag is set in the dwFlags field, the dwPitch field specifies the initial pitch of the audio stream. The pitch is specified as a fixed-point value. The high-order word contains the signed integer part of the number, and the low-order word contains the fractional part. A value of 0x8000 in the low-order word represents one-half, and 0x4000 represents one-quarter. For example, the value 0x00010000 specifies a multiplier of 1.0 (no pitch change), and a value of 0x000F8000 specifies a multiplier of 15.5.

wDGramPort (2 bytes): A 16-bit unsigned integer that, if set to a nonzero value, specifies the client port that the server MUST use to send data over UDP. A zero value means UDP is not supported. This field MUST be specified by using big-endian byte ordering.

wNumberOfFormats (2 bytes): A 16-bit unsigned integer that specifies the number of AUDIO_FORMAT structures that are contained in an sndFormats array.

cLastBlockConfirmed (1 byte): An 8-bit unsigned integer. This field is unused. The value is arbitrary and MUST be ignored on receipt.

wVersion (2 bytes): A 16-bit unsigned integer that specifies the version of the protocol that is supported by the client.<6>

bPad (1 byte): An 8-bit unsigned integer. This field is unused. The value is arbitrary and MUST be ignored on receipt.

sndFormats (variable): A variable-sized array of audio formats that are supported by the client and the server, each conforming in structure to the AUDIO_FORMAT. Each audio format MUST also appear in the Server Audio Formats and Version PDU list of audio formats just sent by the server. The number of formats in the array is wNumberOfFormats.