HKI Core
Classes | Public Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
HKI.Core.Audio.SimpleAudioPlayer Class Reference

This is a AudioPlayer that can play playlist or SoundClips. It allows to play multiple clips at once or only one clip but with fading between clips or immediate switching of clips. More...

Inheritance diagram for HKI.Core.Audio.SimpleAudioPlayer:
HKI.Core.Audio.AudioPlayer

Classes

class  AudioPlayerSettings
 

Public Member Functions

void Setup (AudioPlayerSettings settings)
 
void PlayPlaylist (bool playPlaylist, bool debugLog=true)
 
void ChangePlaylist (Playlist playlist)
 
void ChangePlaylist (Playlist playlist, bool playPlaylist)
 
void PlaySoundClip (SoundClip clip)
 
void PlayAudioLocalization (AudioLocalization audioLocalization)
 
void PlayAudioClip (AudioClip clip, float volume, float pitch)
 
void StopPlayingAllClips ()
 

Properties

AudioPlayerSettings GetSettings [get]
 
bool IsPlayingPlaylist [get]
 
Playlist GetCurrentPlaylist [get]
 

Private Member Functions

AudioSource CreateAudioSource ()
 
IEnumerator PlayClipWithCrossfade (AudioClip clip, float volume, float pitch)
 
IEnumerator PlayNextSoundClipOfPlaylist (float waitTime)
 

Private Attributes

AudioPlayerSettings currentSettings = null
 
List< AudioSource > audioSources = new List<AudioSource>()
 
int currentMainAudioSourceId = 0
 
bool isPlayingPlaylist = false
 
Playlist currentPlaylist = null
 
Coroutine crossfadeCoroutine = null
 
Coroutine playNextSoundClipOfPlaylistCoroutine = null
 

Detailed Description

This is a AudioPlayer that can play playlist or SoundClips. It allows to play multiple clips at once or only one clip but with fading between clips or immediate switching of clips.

This SimpleAudioPlayer won't be setup if created if you want a ready to use player you need to use the AudioPlayer.

Definition at line 14 of file SimpleAudioPlayer.cs.

Member Function Documentation

◆ ChangePlaylist() [1/2]

void HKI.Core.Audio.SimpleAudioPlayer.ChangePlaylist ( Playlist  playlist)
inline

Definition at line 167 of file SimpleAudioPlayer.cs.

◆ ChangePlaylist() [2/2]

void HKI.Core.Audio.SimpleAudioPlayer.ChangePlaylist ( Playlist  playlist,
bool  playPlaylist 
)
inline

Definition at line 181 of file SimpleAudioPlayer.cs.

◆ CreateAudioSource()

AudioSource HKI.Core.Audio.SimpleAudioPlayer.CreateAudioSource ( )
inlineprivate

Definition at line 316 of file SimpleAudioPlayer.cs.

◆ PlayAudioClip()

void HKI.Core.Audio.SimpleAudioPlayer.PlayAudioClip ( AudioClip  clip,
float  volume,
float  pitch 
)
inline

Definition at line 231 of file SimpleAudioPlayer.cs.

◆ PlayAudioLocalization()

void HKI.Core.Audio.SimpleAudioPlayer.PlayAudioLocalization ( AudioLocalization  audioLocalization)
inline

Definition at line 205 of file SimpleAudioPlayer.cs.

◆ PlayClipWithCrossfade()

IEnumerator HKI.Core.Audio.SimpleAudioPlayer.PlayClipWithCrossfade ( AudioClip  clip,
float  volume,
float  pitch 
)
inlineprivate

Definition at line 329 of file SimpleAudioPlayer.cs.

◆ PlayNextSoundClipOfPlaylist()

IEnumerator HKI.Core.Audio.SimpleAudioPlayer.PlayNextSoundClipOfPlaylist ( float  waitTime)
inlineprivate

Definition at line 363 of file SimpleAudioPlayer.cs.

◆ PlayPlaylist()

void HKI.Core.Audio.SimpleAudioPlayer.PlayPlaylist ( bool  playPlaylist,
bool  debugLog = true 
)
inline

Definition at line 141 of file SimpleAudioPlayer.cs.

◆ PlaySoundClip()

void HKI.Core.Audio.SimpleAudioPlayer.PlaySoundClip ( SoundClip  clip)
inline

Definition at line 187 of file SimpleAudioPlayer.cs.

◆ Setup()

void HKI.Core.Audio.SimpleAudioPlayer.Setup ( AudioPlayerSettings  settings)
inline

Definition at line 100 of file SimpleAudioPlayer.cs.

◆ StopPlayingAllClips()

void HKI.Core.Audio.SimpleAudioPlayer.StopPlayingAllClips ( )
inline

Definition at line 299 of file SimpleAudioPlayer.cs.

Member Data Documentation

◆ audioSources

List<AudioSource> HKI.Core.Audio.SimpleAudioPlayer.audioSources = new List<AudioSource>()
private

Definition at line 84 of file SimpleAudioPlayer.cs.

◆ crossfadeCoroutine

Coroutine HKI.Core.Audio.SimpleAudioPlayer.crossfadeCoroutine = null
private

Definition at line 90 of file SimpleAudioPlayer.cs.

◆ currentMainAudioSourceId

int HKI.Core.Audio.SimpleAudioPlayer.currentMainAudioSourceId = 0
private

Definition at line 85 of file SimpleAudioPlayer.cs.

◆ currentPlaylist

Playlist HKI.Core.Audio.SimpleAudioPlayer.currentPlaylist = null
private

Definition at line 88 of file SimpleAudioPlayer.cs.

◆ currentSettings

AudioPlayerSettings HKI.Core.Audio.SimpleAudioPlayer.currentSettings = null
private

Definition at line 82 of file SimpleAudioPlayer.cs.

◆ isPlayingPlaylist

bool HKI.Core.Audio.SimpleAudioPlayer.isPlayingPlaylist = false
private

Definition at line 87 of file SimpleAudioPlayer.cs.

◆ playNextSoundClipOfPlaylistCoroutine

Coroutine HKI.Core.Audio.SimpleAudioPlayer.playNextSoundClipOfPlaylistCoroutine = null
private

Definition at line 91 of file SimpleAudioPlayer.cs.

Property Documentation

◆ GetCurrentPlaylist

Playlist HKI.Core.Audio.SimpleAudioPlayer.GetCurrentPlaylist
get

Definition at line 97 of file SimpleAudioPlayer.cs.

◆ GetSettings

AudioPlayerSettings HKI.Core.Audio.SimpleAudioPlayer.GetSettings
get

Definition at line 94 of file SimpleAudioPlayer.cs.

◆ IsPlayingPlaylist

bool HKI.Core.Audio.SimpleAudioPlayer.IsPlayingPlaylist
get

Definition at line 96 of file SimpleAudioPlayer.cs.


The documentation for this class was generated from the following file: