Sdílet prostřednictvím


SoundEffect.Play3D Method (AudioListener, AudioEmitter, Single, Single, Boolean)

Returns a playing SoundEffectInstance at the specified position using the specified values for volume, pitch, and looping.

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

Syntax

public SoundEffectInstance Play3D (
         AudioListener listener,
         AudioEmitter emitter,
         float volume,
         float pitch,
         bool loop
)

Parameters

  • listener
    Listener position.
  • emitter
    Position of the emitter.
  • volume
    Volume to use when begining playback. Ranging from 0.0f (silence) to 1.0f (full volume). 1.0f is full volume relative to SoundEffect.MasterVolume.
  • pitch
    Pitch adjustment, ranging from -1.0f (down one octave) to 1.0f (up one octave). 0.0f is unity (normal) pitch.
  • loop
    Whether to loop the sound indefinitely, until stopped by the application. Specify true to continuously loop the sound's loop region, or false to play the entire sound just once.

Return Value

A playing SoundEffectInstance at the specified position using the specified values for volume, pitch, and looping.

See Also

Reference

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

Platforms

Xbox 360, Windows XP SP2, Windows Vista, Zune