AudioSink.OnSamples Method

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

When overridden in a derived class, is invoked when an audio device captures a complete audio sample.

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

Syntax

'Declaration
Protected MustOverride Sub OnSamples ( _
    sampleTimeInHundredNanoseconds As Long, _
    sampleDurationInHundredNanoseconds As Long, _
    sampleData As Byte() _
)
protected abstract void OnSamples(
    long sampleTimeInHundredNanoseconds,
    long sampleDurationInHundredNanoseconds,
    byte[] sampleData
)

Parameters

  • sampleTimeInHundredNanoseconds
    Type: System.Int64
    The time, in 100-nanosecond units, when the sample was captured.
  • sampleDurationInHundredNanoseconds
    Type: System.Int64
    The duration of the sample, in 100-nanosecond units.
  • sampleData
    Type: array<System.Byte[]
    A byte stream that contains audio data, to be interpreted per the relevant audio format information.

Remarks

The interval at which OnSamples is called depends on the AudioFrameSize value for the active AudioCaptureDevice.

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.