SoundEffect.Play Method (Microsoft.Xna.Framework.Audio)

Gets an internal SoundEffectInstance and plays it.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1082)
  • C#
  • VB
  • F#
public bool Play()

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

Return Value

Type: System.Boolean
True if a SoundEffectInstance was successfully played, false if not.
Play returns false if more SoundEffectInstances are currently playing then the platform allows.To loop a sound or apply 3D effects, call SoundEffect.CreateInstance() and SoundEffectInstance.Play() instead.SoundEffectInstances used by SoundEffect.Play() are pooled internally.
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web