SoundToolKit  1.5
SoundToolKit.Unity.SoundToolKitSourceSpawner Class Reference

SourceSpawner creates fire-and-forget SpatialSources that play a given SoundToolKitSample at a given location and then dispose of themselves. More...

Inheritance diagram for SoundToolKit.Unity.SoundToolKitSourceSpawner:

Public Member Functions

void SpawnSound (SoundToolKitSample sampleToPlay, Vector3? positionOfSpawn=null)
 Spawn a SoundToolKitSpatialSource playing a single given SoundToolKitSample at a given location. The default position is that of component's parent GameObject. More...
 
void SpawnRandomSound (Vector3? positionOfSpawn=null)
 Spawn a SoundToolKitSpatialSource playing a random SoundToolKitSample from the Samples list at a given position. The default position is that of component's parent GameObject. More...
 
void KillAllSpawnedSources ()
 Destroys all of the SpatialSources spawned by this Spawner immediately. More...
 

Properties

List< SoundToolKitSampleSamples [get, set]
 List of SoundToolKitSamples that can be played by the spawned SoundToolKitSpatialSource More...
 
float Volume [get, set]
 Volume of the sound that will be played More...
 
float SimulationQuality [get, set]
 This currently has no effect. Will be added in the future releases. Determines the quality of source processing. The value affects how many engine resources are delegated for processing sound emitted by this source. The simulation quality also determines the priority of given source, meaning that sources with higher simulation quality can have lower latency. Quality in range 0 to 1.0, where: 1.0 - the best possible quality 0.0 - source not processed at all More...
 
bool HrtfSpatializationEnabled [get, set]
 Enables/Disables HRTF's More...
 
SoundSourceAttenuation Attenuation [get, set]
 The attenuation model which should be used by the spawned sources More...
 
float Radius [get, set]
 Radius of virtual sphere that simulates boundary of source volume. This means that below this distance from source attenuation will not occur. Above that distance attenuation will be calculated according to chosen attenuation curve (see setAttenuation) More...
 
float MaxDistance [get, set]
 Max distance of virtual sphere that simulates boundary of source volume This is only valid in Linear and ReverseLog Attenuation curve. More...
 

Detailed Description

SourceSpawner creates fire-and-forget SpatialSources that play a given SoundToolKitSample at a given location and then dispose of themselves.

Member Function Documentation

◆ KillAllSpawnedSources()

void SoundToolKit.Unity.SoundToolKitSourceSpawner.KillAllSpawnedSources ( )

Destroys all of the SpatialSources spawned by this Spawner immediately.

◆ SpawnRandomSound()

void SoundToolKit.Unity.SoundToolKitSourceSpawner.SpawnRandomSound ( Vector3?  positionOfSpawn = null)

Spawn a SoundToolKitSpatialSource playing a random SoundToolKitSample from the Samples list at a given position. The default position is that of component's parent GameObject.

Parameters
positionOfSpawnPosition at which the Source is spawned. Defaults to the parent GameObject's position.

◆ SpawnSound()

void SoundToolKit.Unity.SoundToolKitSourceSpawner.SpawnSound ( SoundToolKitSample  sampleToPlay,
Vector3?  positionOfSpawn = null 
)

Spawn a SoundToolKitSpatialSource playing a single given SoundToolKitSample at a given location. The default position is that of component's parent GameObject.

Parameters
sampleToPlayThe Sample to be played by the spawned source. Pass an element on the Samples List or a SoundToolKitSample object.
positionOfSpawnPosition at which the Source is spawned. Defaults to the parent GameObject's position.

Property Documentation

◆ Attenuation

SoundSourceAttenuation SoundToolKit.Unity.SoundToolKitSourceSpawner.Attenuation
getset

The attenuation model which should be used by the spawned sources

◆ HrtfSpatializationEnabled

bool SoundToolKit.Unity.SoundToolKitSourceSpawner.HrtfSpatializationEnabled
getset

Enables/Disables HRTF's

◆ MaxDistance

float SoundToolKit.Unity.SoundToolKitSourceSpawner.MaxDistance
getset

Max distance of virtual sphere that simulates boundary of source volume This is only valid in Linear and ReverseLog Attenuation curve.

◆ Radius

float SoundToolKit.Unity.SoundToolKitSourceSpawner.Radius
getset

Radius of virtual sphere that simulates boundary of source volume. This means that below this distance from source attenuation will not occur. Above that distance attenuation will be calculated according to chosen attenuation curve (see setAttenuation)

◆ Samples

List<SoundToolKitSample> SoundToolKit.Unity.SoundToolKitSourceSpawner.Samples
getset

List of SoundToolKitSamples that can be played by the spawned SoundToolKitSpatialSource

◆ SimulationQuality

float SoundToolKit.Unity.SoundToolKitSourceSpawner.SimulationQuality
getset

This currently has no effect. Will be added in the future releases. Determines the quality of source processing. The value affects how many engine resources are delegated for processing sound emitted by this source. The simulation quality also determines the priority of given source, meaning that sources with higher simulation quality can have lower latency. Quality in range 0 to 1.0, where: 1.0 - the best possible quality 0.0 - source not processed at all

◆ Volume

float SoundToolKit.Unity.SoundToolKitSourceSpawner.Volume
getset

Volume of the sound that will be played