Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Volume Property

MediaPlayer.Volume Property

Gets or sets the media player volume.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public static float Volume { get; set; }

Property Value

Media player volume, from 0.0f (silence) to 1.0f (full volume relative to the current device volume).

Volume adjustment is based on a decibel, not multiplicative, scale. For example, when the device volume is half of maximum (about 7 in the Windows Phone user interface), setting Volume to 0.6f or less is silent or nearly so, not volume 4 as you would expect from a multiplicative adjustment.

Setting Volume to 0.0 subtracts 96 dB from the volume. Setting Volume to 1.0 subtracts 0 dB from the volume. Values in between 0.0f and 1.0f subtract dB from the volume proportionally.

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone

Community Additions

© 2015 Microsoft