Table of contents
Collapse the table of content
Expand the table of content

DirectSound Stream Data Range

Last Updated: 10/10/2016

This example uses a KSDATARANGE_AUDIO structure to describe the data range for a DirectSound stream.

  DataRange.FormatSize  = sizeof(KSDATARANGE_AUDIO);
  DataRange.Flags       = 0;
  DataRange.SampleSize  = 0;
  DataRange.Reserved    = 0;
  MaximumChannels        = 4;   // max number of channels, or -1 for unlimited
  MinimumBitsPerSample   = 2;
  MaximumBitsPerSample   = 16;  // 16, 24, 32, etc.
  MinimumSampleFrequency = 5000;
  MaximumSampleFrequency = 48000;

The member values in this example are similar to those of the PCM multichannel stream data range example, with the exception of the MaximumBitsPerSample value. This value is set to the sample container size and should be a multiple of eight. For example, if the device supports 20 bits of valid audio data in 24-bit containers, the value for MaximumBitsPerSample should be set to 24.

Send comments about this topic to Microsoft

© 2016 Microsoft