forked from hunterzonewu/unity-decompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioListener.cs
More file actions
88 lines (78 loc) · 3.93 KB
/
AudioListener.cs
File metadata and controls
88 lines (78 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Decompiled with JetBrains decompiler
// Type: UnityEngine.AudioListener
// Assembly: UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: A8FF7A2C-E4EE-4232-AB17-3FCABEC16496
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEngine.dll
using System;
using System.Runtime.CompilerServices;
namespace UnityEngine
{
/// <summary>
/// <para>Representation of a listener in 3D space.</para>
/// </summary>
public sealed class AudioListener : Behaviour
{
/// <summary>
/// <para>Controls the game sound volume (0.0 to 1.0).</para>
/// </summary>
public static extern float volume { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }
/// <summary>
/// <para>The paused state of the audio system.</para>
/// </summary>
public static extern bool pause { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }
/// <summary>
/// <para>This lets you set whether the Audio Listener should be updated in the fixed or dynamic update.</para>
/// </summary>
public AudioVelocityUpdateMode velocityUpdateMode { [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] get; [WrapperlessIcall, MethodImpl(MethodImplOptions.InternalCall)] set; }
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void GetOutputDataHelper(float[] samples, int channel);
[WrapperlessIcall]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void GetSpectrumDataHelper(float[] samples, int channel, FFTWindow window);
/// <summary>
/// <para>Deprecated Version. Returns a block of the listener (master)'s output data.</para>
/// </summary>
/// <param name="numSamples"></param>
/// <param name="channel"></param>
[Obsolete("GetOutputData returning a float[] is deprecated, use GetOutputData and pass a pre allocated array instead.")]
public static float[] GetOutputData(int numSamples, int channel)
{
float[] samples = new float[numSamples];
AudioListener.GetOutputDataHelper(samples, channel);
return samples;
}
/// <summary>
/// <para>Provides a block of the listener (master)'s output data.</para>
/// </summary>
/// <param name="samples">The array to populate with audio samples. Its length must be a power of 2.</param>
/// <param name="channel">The channel to sample from.</param>
public static void GetOutputData(float[] samples, int channel)
{
AudioListener.GetOutputDataHelper(samples, channel);
}
/// <summary>
/// <para>Deprecated Version. Returns a block of the listener (master)'s spectrum data.</para>
/// </summary>
/// <param name="numSamples"></param>
/// <param name="channel"></param>
/// <param name="window"></param>
[Obsolete("GetSpectrumData returning a float[] is deprecated, use GetOutputData and pass a pre allocated array instead.")]
public static float[] GetSpectrumData(int numSamples, int channel, FFTWindow window)
{
float[] samples = new float[numSamples];
AudioListener.GetSpectrumDataHelper(samples, channel, window);
return samples;
}
/// <summary>
/// <para>Provides a block of the listener (master)'s spectrum data.</para>
/// </summary>
/// <param name="samples">The array to populate with audio samples. Its length must be a power of 2.</param>
/// <param name="channel">The channel to sample from.</param>
/// <param name="window">The FFTWindow type to use when sampling.</param>
public static void GetSpectrumData(float[] samples, int channel, FFTWindow window)
{
AudioListener.GetSpectrumDataHelper(samples, channel, window);
}
}
}