Table of Contents

Class SoundPlayer

Namespace
Root
Assembly
SPZGameAssembly.dll
public class SoundPlayer : ISoundPlayer
Inheritance
object
SoundPlayer
Implements
Extension Methods

Constructors

SoundPlayer(Transform, IPrefabInstanceProvider, ILogger)

public SoundPlayer(Transform sfxParent, IPrefabInstanceProvider prefabInstanceProvider, ILogger logger)

Parameters

sfxParent Transform
prefabInstanceProvider IPrefabInstanceProvider
logger ILogger

Methods

ChangeSoundPitch(SoundHandle, float)

public void ChangeSoundPitch(SoundHandle soundHandle, float pitch)

Parameters

soundHandle SoundHandle
pitch float

ChangeSoundPosition(SoundHandle, float3)

public void ChangeSoundPosition(SoundHandle soundHandle, float3 position)

Parameters

soundHandle SoundHandle
position float3

ChangeSoundVolume(SoundHandle, float)

public void ChangeSoundVolume(SoundHandle soundHandle, float volume)

Parameters

soundHandle SoundHandle
volume float

Dispose()

public void Dispose()

DspEndTime(SoundHandle)

public double DspEndTime(SoundHandle soundHandle)

Parameters

soundHandle SoundHandle

Returns

double

IsSoundPlaying(SoundHandle)

public bool IsSoundPlaying(SoundHandle soundHandle)

Parameters

soundHandle SoundHandle

Returns

bool

PlayLoopingSound(SoundEffect, Action<SoundHandle>)

public SoundHandle PlayLoopingSound(SoundEffect effect, Action<SoundHandle> onSoundStopped = null)

Parameters

effect SoundEffect
onSoundStopped Action<SoundHandle>

Returns

SoundHandle

PlayLoopingSound(SoundEffect, float, Action<SoundHandle>)

public SoundHandle PlayLoopingSound(SoundEffect effect, float pitch, Action<SoundHandle> onSoundStopped = null)

Parameters

effect SoundEffect
pitch float
onSoundStopped Action<SoundHandle>

Returns

SoundHandle

PlayLoopingSound(SoundEffect, float3, Action<SoundHandle>)

public SoundHandle PlayLoopingSound(SoundEffect effect, float3 position, Action<SoundHandle> onSoundStopped)

Parameters

effect SoundEffect
position float3
onSoundStopped Action<SoundHandle>

Returns

SoundHandle

PlayLoopingSound(SoundEffect, float3, float, Action<SoundHandle>)

public SoundHandle PlayLoopingSound(SoundEffect effect, float3 position, float pitch, Action<SoundHandle> onSoundStopped)

Parameters

effect SoundEffect
position float3
pitch float
onSoundStopped Action<SoundHandle>

Returns

SoundHandle

PlaySound(SoundEffect, Action<SoundHandle>)

public SoundHandle PlaySound(SoundEffect effect, Action<SoundHandle> onSoundStopped = null)

Parameters

effect SoundEffect
onSoundStopped Action<SoundHandle>

Returns

SoundHandle

PlaySound(SoundEffect, Action<SoundHandle>, float, double)

public SoundHandle PlaySound(SoundEffect effect, Action<SoundHandle> onSoundStopped, float pitch, double startOffset = 0)

Parameters

effect SoundEffect
onSoundStopped Action<SoundHandle>
pitch float
startOffset double

Returns

SoundHandle

PlaySound(SoundEffect, float3, Action<SoundHandle>)

public SoundHandle PlaySound(SoundEffect effect, float3 position, Action<SoundHandle> onSoundStopped)

Parameters

effect SoundEffect
position float3
onSoundStopped Action<SoundHandle>

Returns

SoundHandle

PlaySound(SoundEffect, float3, Action<SoundHandle>, float, double)

public SoundHandle PlaySound(SoundEffect effect, float3 position, Action<SoundHandle> onSoundStopped, float pitch, double startOffset = 0)

Parameters

effect SoundEffect
position float3
onSoundStopped Action<SoundHandle>
pitch float
startOffset double

Returns

SoundHandle

PlaySoundDelayed(SoundEffect, Action<SoundHandle>, double, double, float)

public SoundHandle PlaySoundDelayed(SoundEffect effect, Action<SoundHandle> onSoundStopped, double delay, double startOffset = 0, float pitch = 1)

Parameters

effect SoundEffect
onSoundStopped Action<SoundHandle>
delay double
startOffset double
pitch float

Returns

SoundHandle

PlaySoundDelayed(SoundEffect, float3, Action<SoundHandle>, double, double, float)

public SoundHandle PlaySoundDelayed(SoundEffect effect, float3 position, Action<SoundHandle> onSoundStopped, double delay, double startOffset = 0, float pitch = 1)

Parameters

effect SoundEffect
position float3
onSoundStopped Action<SoundHandle>
delay double
startOffset double
pitch float

Returns

SoundHandle

TryStopSound(SoundHandle)

public bool TryStopSound(SoundHandle soundHandle)

Parameters

soundHandle SoundHandle

Returns

bool

Update()

public void Update()