Поделиться через


AudioCaptureDevice.AudioFrameSize Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the intended audio frame size.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property AudioFrameSize As Integer
public int AudioFrameSize { get; set; }

Property Value

Type: System.Int32
The audio frame size, in milliseconds. The default is 1000. See Remarks.

Remarks

The minimum value is 10 milliseconds, and the maximum value is 2000 milliseconds. Setting AudioFrameSize to a value greater than 2000 or less than 10 does not throw an exception; however, the stored value is constrained to be within those restrictions.

AudioFrameSize influences the sample size if you process audio sink sample information with overrides of OnSamples.

TipTip:

Setting the AudioFrameSize correctly for your sample processing technique and application scenario may take some tuning to arrive at optimal frame size for a balance between quality and application performance. A too-long frame size can produce latency if you are time-dependent on immediate playback or other actions that should result from audio capture. A too-short frame size can result in buffer underrun. A buffer underrun can result from trying to play audio that has not made it through the record buffer and processing yet. Such buffer underruns might produce audible artifacts in the sound playback or obvious sample gaps in converted sound files.

Version Information

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.