Singleton class that provides audio playback behavior such as oneshot, loop, reverse. DO NOT INSTANCIATE!
More...
|
static AudioSource | CreateBinaural (string pathToSoundfile, Dictionary< string, float > options) |
| Creates a binaural audio source using Google Resonance Audio Plugin. More...
|
|
static AudioSource | Create (string pathToSoundfile) |
| Creates an audio source. More...
|
|
static void | Loop (AudioSource audioSource, float loopStart=-1, float loopEnd=-1, int times=-1) |
| Plays a source as a loop. More...
|
|
static void | OneShot (AudioSource audioSource) |
| Play a source as one-shot. If called on a looped AudioSource, it is equivalent to ExitLoop(). More...
|
|
static void | StopImmediately (AudioSource s) |
| Atops an audiosource immediately, no matter if it is looping or not. More...
|
|
static void | ExitLoop (AudioSource s) |
| Plays until the loop end point, then exits the loop, plays until the end of the file and stops. More...
|
|
static void | ExitLoopImmediately (AudioSource s) |
| Jumps to the end point of the loop immediately, then plays to the end of the clip, then stops. More...
|
|
static void | RestartLoop (AudioSource s) |
| Immediately jumps to the start of the loop. this overrides preiously defined looping behavior. More...
|
|
static void | Reverse (AudioSource s) |
| Plays an audio source in reverse. More...
|
|
|
static Dictionary< AudioSource, float > | loopStartList = new Dictionary<AudioSource, float>() |
|
static Dictionary< AudioSource, float > | loopEndList = new Dictionary<AudioSource, float>() |
|
static Dictionary< AudioSource, float > | iterList = new Dictionary<AudioSource, float>() |
|
Singleton class that provides audio playback behavior such as oneshot, loop, reverse. DO NOT INSTANCIATE!
◆ Create()
static AudioSource AudioCenter.Create |
( |
string |
pathToSoundfile | ) |
|
|
static |
Creates an audio source.
- Parameters
-
pathToSoundfile | The path to the soundfile relative to the project's Resources folder, without file extension. |
options | Provide options such as movement speed of the source. |
- Returns
- An
AudioSource
instance or null if the audio file could not be found.
◆ CreateBinaural()
static AudioSource AudioCenter.CreateBinaural |
( |
string |
pathToSoundfile, |
|
|
Dictionary< string, float > |
options |
|
) |
| |
|
static |
Creates a binaural audio source using Google Resonance Audio Plugin.
- Parameters
-
pathToSoundfile | The path to the soundfile relative to the project's Resources folder, without file extension. |
options | Provide options such as movement speed of the source. |
- Returns
- An
AudioSource
instance or null if the audio file could not be found.
◆ ExitLoop()
static void AudioCenter.ExitLoop |
( |
AudioSource |
s | ) |
|
|
static |
Plays until the loop end point, then exits the loop, plays until the end of the file and stops.
- Parameters
-
s | The AudioSource to stop. |
◆ ExitLoopImmediately()
static void AudioCenter.ExitLoopImmediately |
( |
AudioSource |
s | ) |
|
|
static |
Jumps to the end point of the loop immediately, then plays to the end of the clip, then stops.
- Parameters
-
s | The AudioSource to stop. |
◆ Loop()
static void AudioCenter.Loop |
( |
AudioSource |
audioSource, |
|
|
float |
loopStart = -1 , |
|
|
float |
loopEnd = -1 , |
|
|
int |
times = -1 |
|
) |
| |
|
static |
Plays a source as a loop.
- Parameters
-
audioSource | The AudioSource that should be looped. |
loopStart | The start point of the loop. If not specified, loops from beginning of file. |
loopEnd | The end point of the loop. If not specified, loops to end of file. |
times | The number of iterations. If not specified, loops endlessly. |
◆ OneShot()
static void AudioCenter.OneShot |
( |
AudioSource |
audioSource | ) |
|
|
static |
Play a source as one-shot. If called on a looped AudioSource, it is equivalent to ExitLoop().
- Parameters
-
audioSource | The AudioSource to play. |
◆ RestartLoop()
static void AudioCenter.RestartLoop |
( |
AudioSource |
s | ) |
|
|
static |
Immediately jumps to the start of the loop. this overrides preiously defined looping behavior.
- Parameters
-
s | The AudioSource to restart. |
◆ Reverse()
static void AudioCenter.Reverse |
( |
AudioSource |
s | ) |
|
|
static |
Plays an audio source in reverse.
- Parameters
-
s | The AudioSource to reverse. |
◆ StopImmediately()
static void AudioCenter.StopImmediately |
( |
AudioSource |
s | ) |
|
|
static |
Atops an audiosource immediately, no matter if it is looping or not.
- Parameters
-
s | The AudioSource to stop. |
The documentation for this class was generated from the following file:
- /Users/hannes/Desktop/MA/RunnersHigh/Assets/Scripts/RunnersHigh/Documented/AudioCenter.cs