Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Removed 3d sound effects.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed May 21, 2020
1 parent d6e7201 commit 383ffae
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 195 deletions.
174 changes: 87 additions & 87 deletions MonoGame/MonoGame.Framework/Audio/AudioEmitter.cs
Original file line number Diff line number Diff line change
@@ -1,87 +1,87 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Xna.Framework.Audio
{
/// <summary>
/// Represents a 3D audio emitter. Used to simulate 3D audio effects.
/// </summary>
public class AudioEmitter
{
/// <summary>Initializes a new AudioEmitter instance.</summary>
public AudioEmitter ()
{
_dopplerScale = 1.0f;
Forward = Vector3.Forward;
Position = Vector3.Zero;
Up = Vector3.Up;
Velocity = Vector3.Zero;
}

private float _dopplerScale;

/// <summary>Gets or sets a scale applied to the Doppler effect between the AudioEmitter and an AudioListener.</summary>
/// <remarks>
/// <para>Defaults to 1.0</para>
/// <para>A value of 1.0 leaves the Doppler effect unmodified.</para>
/// </remarks>
public float DopplerScale
{
get
{
return _dopplerScale;
}

set
{
if (value < 0.0f)
throw new ArgumentOutOfRangeException("AudioEmitter.DopplerScale must be greater than or equal to 0.0f");

_dopplerScale = value;
}
}

/// <summary>Gets or sets the emitter's forward vector.</summary>
/// <remarks>
/// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para>
/// <para>Used with AudioListener.Velocity to calculate Doppler values.</para>
/// <para>The Forward and Up values must be orthonormal.</para>
/// </remarks>
public Vector3 Forward {
get;
set;
}

/// <summary>Gets or sets the position of this emitter.</summary>
public Vector3 Position {
get;
set;
}

/// <summary>Gets or sets the emitter's Up vector.</summary>
/// <remarks>
/// <para>Defaults to Vector3.Up. (new Vector3(0, -1, 1)).</para>
/// <para>The Up and Forward vectors must be orthonormal.</para>
/// </remarks>
public Vector3 Up {
get;
set;
}

/// <summary>Gets or sets the emitter's velocity vector.</summary>
/// <remarks>
/// <para>Defaults to Vector3.Zero.</para>
/// <para>This value is only used when calculating Doppler values.</para>
/// </remarks>
public Vector3 Velocity {
get;
set;
}

}
}
// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// using System;
// using System.Collections.Generic;
// using System.Text;
//
// namespace Microsoft.Xna.Framework.Audio
// {
// /// <summary>
// /// Represents a 3D audio emitter. Used to simulate 3D audio effects.
// /// </summary>
// public class AudioEmitter
// {
// /// <summary>Initializes a new AudioEmitter instance.</summary>
// public AudioEmitter ()
// {
// _dopplerScale = 1.0f;
// Forward = Vector3.Forward;
// Position = Vector3.Zero;
// Up = Vector3.Up;
// Velocity = Vector3.Zero;
// }
//
// private float _dopplerScale;
//
// /// <summary>Gets or sets a scale applied to the Doppler effect between the AudioEmitter and an AudioListener.</summary>
// /// <remarks>
// /// <para>Defaults to 1.0</para>
// /// <para>A value of 1.0 leaves the Doppler effect unmodified.</para>
// /// </remarks>
// public float DopplerScale
// {
// get
// {
// return _dopplerScale;
// }
//
// set
// {
// if (value < 0.0f)
// throw new ArgumentOutOfRangeException("AudioEmitter.DopplerScale must be greater than or equal to 0.0f");
//
// _dopplerScale = value;
// }
// }
//
// /// <summary>Gets or sets the emitter's forward vector.</summary>
// /// <remarks>
// /// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para>
// /// <para>Used with AudioListener.Velocity to calculate Doppler values.</para>
// /// <para>The Forward and Up values must be orthonormal.</para>
// /// </remarks>
// public Vector3 Forward {
// get;
// set;
// }
//
// /// <summary>Gets or sets the position of this emitter.</summary>
// public Vector3 Position {
// get;
// set;
// }
//
// /// <summary>Gets or sets the emitter's Up vector.</summary>
// /// <remarks>
// /// <para>Defaults to Vector3.Up. (new Vector3(0, -1, 1)).</para>
// /// <para>The Up and Forward vectors must be orthonormal.</para>
// /// </remarks>
// public Vector3 Up {
// get;
// set;
// }
//
// /// <summary>Gets or sets the emitter's velocity vector.</summary>
// /// <remarks>
// /// <para>Defaults to Vector3.Zero.</para>
// /// <para>This value is only used when calculating Doppler values.</para>
// /// </remarks>
// public Vector3 Velocity {
// get;
// set;
// }
//
// }
// }
138 changes: 69 additions & 69 deletions MonoGame/MonoGame.Framework/Audio/AudioListener.cs
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Xna.Framework.Audio
{
/// <summary>
/// Represents a 3D audio listener. Used when simulating 3D Audio.
/// </summary>
public class AudioListener
{
public AudioListener ()
{
Forward = Vector3.Forward;
Position = Vector3.Zero;
Up = Vector3.Up;
Velocity = Vector3.Zero;
}

/// <summary>Gets or sets the listener's forward vector.</summary>
/// <remarks>
/// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para>
/// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para>
/// <para>The Forward and Up vectors must be orthonormal.</para>
/// </remarks>
public Vector3 Forward {
get;
set;
}

/// <summary>Gets or sets the listener's position.</summary>
/// <remarks>
/// Defaults to Vector3.Zero.
/// </remarks>
public Vector3 Position {
get;
set;
}

/// <summary>
/// Gets or sets the listener's up vector..
/// </summary>
/// <remarks>
/// <para>Defaults to Vector3.Up (New Vector3(0, -1, 0)).</para>
/// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para>
/// <para>The values of the Forward and Up vectors must be orthonormal.</para>
/// </remarks>
public Vector3 Up {
get;
set;
}

/// <summary>Gets or sets the listener's velocity vector.</summary>
/// <remarks>
/// <para>Defaults to Vector3.Zero.</para>
/// <para>Scaled by DopplerScale to calculate the Doppler effect value applied to a Cue.</para>
/// <para>This value is only used to calculate Doppler values.</para>
/// </remarks>
public Vector3 Velocity {
get;
set;
}
}
}

// // MonoGame - Copyright (C) The MonoGame Team
// // This file is subject to the terms and conditions defined in
// // file 'LICENSE.txt', which is part of this source code package.
//
// using System;
// using System.Collections.Generic;
// using System.Text;
//
// namespace Microsoft.Xna.Framework.Audio
// {
// /// <summary>
// /// Represents a 3D audio listener. Used when simulating 3D Audio.
// /// </summary>
// public class AudioListener
// {
// public AudioListener ()
// {
// Forward = Vector3.Forward;
// Position = Vector3.Zero;
// Up = Vector3.Up;
// Velocity = Vector3.Zero;
// }
//
// /// <summary>Gets or sets the listener's forward vector.</summary>
// /// <remarks>
// /// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para>
// /// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para>
// /// <para>The Forward and Up vectors must be orthonormal.</para>
// /// </remarks>
// public Vector3 Forward {
// get;
// set;
// }
//
// /// <summary>Gets or sets the listener's position.</summary>
// /// <remarks>
// /// Defaults to Vector3.Zero.
// /// </remarks>
// public Vector3 Position {
// get;
// set;
// }
//
// /// <summary>
// /// Gets or sets the listener's up vector..
// /// </summary>
// /// <remarks>
// /// <para>Defaults to Vector3.Up (New Vector3(0, -1, 0)).</para>
// /// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para>
// /// <para>The values of the Forward and Up vectors must be orthonormal.</para>
// /// </remarks>
// public Vector3 Up {
// get;
// set;
// }
//
// /// <summary>Gets or sets the listener's velocity vector.</summary>
// /// <remarks>
// /// <para>Defaults to Vector3.Zero.</para>
// /// <para>Scaled by DopplerScale to calculate the Doppler effect value applied to a Cue.</para>
// /// <para>This value is only used to calculate Doppler values.</para>
// /// </remarks>
// public Vector3 Velocity {
// get;
// set;
// }
// }
// }
//
18 changes: 9 additions & 9 deletions MonoGame/MonoGame.Framework/Audio/SoundEffectInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ internal SoundEffectInstance(byte[] buffer, int sampleRate, int channels)
/// <summary>Applies 3D positioning to the SoundEffectInstance using a single listener.</summary>
/// <param name="listener">Data about the listener.</param>
/// <param name="emitter">Data about the source of emission.</param>
public void Apply3D(AudioListener listener, AudioEmitter emitter)
{
PlatformApply3D(listener, emitter);
}
// public void Apply3D(AudioListener listener, AudioEmitter emitter)
// {
// PlatformApply3D(listener, emitter);
// }

/// <summary>Applies 3D positioning to the SoundEffectInstance using multiple listeners.</summary>
/// <param name="listeners">Data about each listener.</param>
/// <param name="emitter">Data about the source of emission.</param>
public void Apply3D(AudioListener[] listeners, AudioEmitter emitter)
{
foreach (var l in listeners)
PlatformApply3D(l, emitter);
}
// public void Apply3D(AudioListener[] listeners, AudioEmitter emitter)
// {
// foreach (var l in listeners)
// PlatformApply3D(l, emitter);
// }

/// <summary>Pauses playback of a SoundEffectInstance.</summary>
/// <remarks>Paused instances can be resumed with SoundEffectInstance.Play() or SoundEffectInstance.Resume().</remarks>
Expand Down

0 comments on commit 383ffae

Please sign in to comment.