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

SoundEffect.MasterVolume Property

Gets or sets the master volume that affects all SoundEffectInstance sounds.

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

public static float MasterVolume { get; set; }

Property Value

Volume, ranging from 0.0f (silence) to 1.0f (current device volume). 1.0f is full volume relative to the current device volume.

The sound effect master volume affects all sound effect instances, including currently playing instances and newly created instances. Each SoundEffectInstance also has its own volume (SoundEffectInstance.Volume) that is relative to the master volume.

You can adjust the volume of all sounds effects by changing MasterVolume. You can adjust the volume of an individual SoundEffectInstance by changing SoundEffectInstance.Volume, or by specifying an instance volume when you call Play to create the instance.

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

Community Additions

© 2015 Microsoft