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)

Syntax

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.

Remarks

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.

See Also

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Platforms

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