KinectAudioSource.Start Method (TimeSpan)
Kinect for Windows 1.5, 1.6, 1.7, 1.8Opens an audio data stream (16-bit PCM format, sampled at 16 kHz) with a time parameter for discarding unnecessary data, and starts capturing audio data streamed out of a sensor.
Once the data stream is open, use the returned Stream Class to read audio data.
When setting the value for readStaleThreshold:
- Higher values for this threshold (multiple seconds) are advisable if clients notice dropped audio packets, which is more likely in high-CPU-load scenarios.
- If there are no reads to the stream for longer than the time set in readStaleThreshold, the DirectX Media Object (DMO) will discard buffered audio. This prevents stale data from being returned in scenarios such as speech recognition, systems that display user dialogs, or other scenarios when the consumption of audio samples may be intermittent. Set this parameter to TimeSpan.MaxValue to disable this behavior.
- If the stream data is not read and the buffered audio exceeds the size specified in readStaleThreshold, the oldest samples are discarded.
Use KinectAudioSource.Start () if you do not need to supply a timeout.
Use KinectAudioSource.Stop to stop capturing audio data and close the audio data stream.