OnSamples Method

AudioSink.OnSamples Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

protected abstract void OnSamples(
	long sampleTimeInHundredNanoseconds,
	long sampleDurationInHundredNanoseconds,
	byte[] sampleData


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

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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

© 2016 Microsoft