Share via


KinectAudioSource.Start Method (TimeSpan)

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Opens 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.

Syntax

public Stream Start (
         TimeSpan readStaleThreshold
)
'Declaration
Public Function Start ( _
         readStaleThreshold As TimeSpan _
) As Stream 

Parameters

  • readStaleThreshold
    Type: TimeSpan
    Maximum length of time data before data is discarded. See the remarks.

Return Value

Type: Stream
A stream of audio samples, in 16khz, 16-bit PCM format.

Remarks

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.

Requirements

Namespace: Microsoft.Kinect

Assembly: Microsoft.Kinect (in microsoft.kinect.dll)

See Also

Reference

KinectAudioSource Class
KinectAudioSource Members
Microsoft.Kinect Namespace