Export (0) Print
Expand All

AudioSink.OnFormatChange Method

Silverlight

When overridden in a derived class, is invoked when an audio device reports an audio format change.

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

protected abstract void OnFormatChange(
	AudioFormat audioFormat
)

Parameters

audioFormat
Type: System.Windows.Media.AudioFormat
The new audio format.

The AudioFormat for a sink can differ from the format that is requested in AudioCaptureDevice.DesiredFormat.

When an audio capture starts in the sink, OnFormatChange is invoked at least one time by the system for the first capture by that sink. Therefore, you can use OnFormatChange as the definitive determination of audio format instead of using DesiredFormat or SupportedFormats.

The AudioCaptureDevice properties are intended for determining whether your application logic can support capture and sample conversion for a particular device based on its formats. (You can also prompt users to change devices in their configuration UI if the GetAvailableAudioCaptureDevices method reports alternatives that would work when the current default device is not supported.)

A format change from the audio device (including getting the initial format of the capture) would typically also be relevant to your OnSamples implementation.

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

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

Community Additions

ADD
Show:
© 2014 Microsoft