|  | Adventure Creator 1.84.3
    An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024 | 
 
  
| Classes | |
| struct | QueuedSoundtrack | 
| struct | SoundtrackSample | 
| Public Member Functions | |
| override void | _Update () | 
| void | ClearData () | 
| float | Play (int trackID, bool loop, bool isQueued, float fadeTime, bool resumeIfPlayedBefore=false, int newTrackTimeSamples=0, float loopingOverlapTime=0f) | 
| Plays a new soundtrack. | |
| float | Crossfade (int trackID, bool loop, bool isQueued, float fadeTime, bool resumeIfPlayedBefore=false, int newTrackTimeSamples=0, float loopingOverlapTime=0f) | 
| Crossfade a new soundtrack. | |
| float | ResumeLastQueue (float fadeTime, bool playFromStart) | 
| Resumes the last-played soundtrack queue. | |
| float | StopAll (float fadeTime, bool storeCurrentIndex=true) | 
| Stops the currently-playing track, and cancels all those in the queue. | |
| virtual MainData | SaveMainData (MainData mainData) | 
| Updates a MainData class with its own variables that need saving. | |
| virtual void | LoadMainData (MainData mainData) | 
| Updates its own variables from a MainData class. | |
| int | GetCurrentTrackID () | 
| void | SyncTrackWithCurrent (int trackID, int sampleOffset=0) | 
| Sets the recorded 'time sample' of a track to match the currently-playing audio. This is useful if you want to blend into a new track at the same position as the current one, via the 'resumeIfPlayedBefore' option in the Play function. | |
| Public Member Functions inherited from AC.Sound | |
| void | Interact () | 
| void | FadeIn (float _fadeTime, bool loop, int _timeSamples=0) | 
| Fades in the AudioSource's current AudioClip, after which it continues to play. | |
| void | FadeOut (float _fadeTime) | 
| Fades out the AudioSource's current AudioClip, after which it stops. | |
| bool | IsFadingOut () | 
| Checks if the AudioSource's AudioClip is being faded out. | |
| void | Play () | 
| void | Play (bool loop) | 
| Plays the AudioSource's current AudioClip. | |
| void | Play (AudioClip clip, bool loop, int _timeSamples=0) | 
| Plays an AudioClip. | |
| void | PlayAtPoint (bool loop, int samplePoint) | 
| Plays the AudioSource's current AudioClip from a set point. | |
| void | SetMaxVolume () | 
| void | SetVolume (float volume) | 
| Sets the volume, but takes relativeVolume into account as well. | |
| void | ChangeRelativeVolume (float newRelativeVolume, float changeTime=0f) | 
| Changes the relativeVolume value. | |
| void | Stop () | 
| bool | IsFading () | 
| Checks if the sound is fading in or out. | |
| bool | IsPlaying () | 
| Checks if sound is playing. | |
| bool | IsPlaying (AudioClip clip) | 
| Checks if a particular AudioClip is playing. | |
| void | TryDestroy () | 
| void | EndOld (SoundType _soundType, Sound ignoreSound) | 
| Fades out all sounds of a particular type being played. | |
| SoundData | GetSaveData (SoundData soundData) | 
| Updates a SoundData class with its own variables that need saving. | |
| void | LoadData (SoundData soundData) | 
| Updates its own variables from a SoundData class. | |
| Protected Member Functions | |
| void | Awake () | 
| override void | OnEnable () | 
| override void | OnDisable () | 
| bool | IsCrossfading () | 
| void | CreateNewCrossfade (float fadeTime) | 
| void | EndOthers () | 
| virtual bool | EndsOthers () | 
| float | HandlePlay (int trackID, bool loop, bool isQueued, float fadeTime, bool isCrossfade, bool resumeIfPlayedBefore, int newTrackTimeSamples=0, float loopingOverlapTime=0f) | 
| float | ForceStopAll (float fadeTime, bool storeCurrentIndex=true) | 
| void | ClearSoundtrackQueue () | 
| void | FadeOutThenIn (MusicStorage musicStorage, float fadeTime, bool loop, bool resumeIfPlayedBefore, int newTrackTimeSamples) | 
| void | AfterDelay () | 
| void | Resume (int _timeSamples, float fadeTime=0f) | 
| void | HandleFadeIn (float _fadeTime, bool loop, int _timeSamples) | 
| string | CreateTimesampleString () | 
| string | CreateLastSoundtrackString () | 
| string | CreateOldTimesampleString () | 
| void | LoadMainData (int _timeSamples, string _oldTimeSamples, int _lastTimeSamples, string _lastQueueData, string _queueData) | 
| MusicStorage | GetSoundtrack (int ID) | 
| void | SetRelativeVolume (float _relativeVolume) | 
| void | StoreSoundtrackSampleByIndex (int index) | 
| int | GetSoundtrackSample (int trackID) | 
| void | ClearSoundtrackSample (int trackID) | 
| void | SetSoundtrackSample (int trackID, int timeSample) | 
| Protected Member Functions inherited from AC.Sound | |
| void | Start () | 
| void | OnEnterGameState (GameState gameState) | 
| void | OnInitialiseScene () | 
| void | OnChangeVolume (SoundType _soundType, float newVolume) | 
| void | SetSmoothVolume () | 
| void | SnapSmoothVolume () | 
| void | SetFinalVolume () | 
| void | TurnOn () | 
| void | TurnOff () | 
| void | Kill () | 
| Protected Attributes | |
| List< QueuedSoundtrack > | queuedSoundtrack = new List<QueuedSoundtrack>() | 
| List< MusicCrossfade > | crossfades = new List<MusicCrossfade>() | 
| List< QueuedSoundtrack > | lastQueuedSoundtrack = new List<QueuedSoundtrack>() | 
| List< SoundtrackSample > | oldSoundtrackSamples = new List<SoundtrackSample>() | 
| int | lastTimeSamples | 
| float | delayTime | 
| int | delayAudioID = -1 | 
| float | delayFadeTime | 
| bool | delayLoop | 
| bool | delayResumeIfPlayedBefore | 
| int | delayNewTrackTimeSamples | 
| bool | wasPlayingLastFrame | 
| Protected Attributes inherited from AC.Sound | |
| float | maxVolume = 1f | 
| float | smoothVolume = 1f | 
| float | smoothUpdateSpeed = 20f | 
| float | fadeTime | 
| float | originalFadeTime | 
| FadeType | fadeType | 
| Options | options | 
| AudioSource | _audioSource | 
| float | otherVolume = 1f | 
| float | originalRelativeVolume | 
| float | targetRelativeVolume | 
| float | relativeChangeTime | 
| float | originalRelativeChangeTime | 
| bool | gameIsPaused | 
| Properties | |
| virtual List< MusicStorage > | Storages  [get] | 
| int | LastTimeSamples  [get] | 
| virtual bool | IsMusic  [get] | 
| virtual float | LoadFadeTime  [get] | 
| virtual bool | CrossfadeWhenLoading  [get] | 
| virtual bool | RestartTrackWhenLoading  [get] | 
| Properties inherited from AC.Sound | |
| AudioSource | audioSource  [get] | 
| Additional Inherited Members | |
| Public Attributes inherited from AC.Sound | |
| SoundType | soundType | 
| bool | playWhilePaused = false | 
| float | relativeVolume = 1f | 
| bool | surviveSceneChange = false | 
| 
 | virtual | 
Updates the AudioSource's volume. This is called every frame by StateHandler.
Reimplemented from AC.Sound.
| void AC.Soundtrack.ClearData | ( | ) | 
Clears all runtime data related to the soundtrack
| float AC.Soundtrack.Crossfade | ( | int | trackID, | 
| bool | loop, | ||
| bool | isQueued, | ||
| float | fadeTime, | ||
| bool | resumeIfPlayedBefore = false, | ||
| int | newTrackTimeSamples = 0, | ||
| float | loopingOverlapTime = 0f ) | 
Crossfade a new soundtrack.
| trackID | The ID number of the track, as generated by the MusicStorage class that stores the AudioClip 
 | 
| int AC.Soundtrack.GetCurrentTrackID | ( | ) | 
The ID number of the currently-playing track.
| 
 | virtual | 
Updates its own variables from a MainData class.
| mainData | The MainData class to load from | 
Reimplemented in AC.Ambience, and AC.Music.
| 
 | protectedvirtual | 
Reimplemented from AC.Sound.
| 
 | protectedvirtual | 
Reimplemented from AC.Sound.
| float AC.Soundtrack.Play | ( | int | trackID, | 
| bool | loop, | ||
| bool | isQueued, | ||
| float | fadeTime, | ||
| bool | resumeIfPlayedBefore = false, | ||
| int | newTrackTimeSamples = 0, | ||
| float | loopingOverlapTime = 0f ) | 
Plays a new soundtrack.
| trackID | The ID number of the track, as generated by the MusicStorage class that stores the AudioClip 
 | 
| float AC.Soundtrack.ResumeLastQueue | ( | float | fadeTime, | 
| bool | playFromStart ) | 
Resumes the last-played soundtrack queue.
| fadeTime | The fade-in time in seconds, if greater than zero | 
| playFromStart | If True, the track will play from the beginning | 
Updates a MainData class with its own variables that need saving.
| mainData | The original MainData class | 
Reimplemented in AC.Ambience, and AC.Music.
| float AC.Soundtrack.StopAll | ( | float | fadeTime, | 
| bool | storeCurrentIndex = true ) | 
Stops the currently-playing track, and cancels all those in the queue.
| fadeTime | The time over which to stop the track | 
| storeCurrentIndex | If the current time index of the track will be stored so that it can be resumed later | 
| void AC.Soundtrack.SyncTrackWithCurrent | ( | int | trackID, | 
| int | sampleOffset = 0 ) | 
Sets the recorded 'time sample' of a track to match the currently-playing audio. This is useful if you want to blend into a new track at the same position as the current one, via the 'resumeIfPlayedBefore' option in the Play function.
| trackID | The ID of the track to sync with the currently-playing audio | 
| sampleOffset | An offset value to apply to the track, on top of the current audio's timeSamples |