/// <summary> /// play sound /// </summary> /// <param name="loop"></param> /// <param name="volume"></param> public override void Play(bool loop, int volume) { Microsoft.DirectX.DirectSound.BufferPlayFlags flags = Microsoft.DirectX.DirectSound.BufferPlayFlags.Default; if (loop) { flags = Microsoft.DirectX.DirectSound.BufferPlayFlags.Looping; } SetVolume(volume); m_secondaryBuffer.Play(0, flags); }
public override void Play(SoundVector pos, bool loop, int volume) { Microsoft.DirectX.DirectSound.BufferPlayFlags flags = Microsoft.DirectX.DirectSound.BufferPlayFlags.Default; if (loop) { flags = Microsoft.DirectX.DirectSound.BufferPlayFlags.Looping; } UpdatePosition(pos); SetVolume(volume); m_secondaryBuffer.Play(0, flags); }