class in Clatter.Unity
Inherits from Sound
, MonoBehaviour
A sound generated by an scrape event and ClatterManager
. A ScrapeSound will persist after its audio clip ends, and will try to play more scrape audio; it will be fed new audio from ClatterManager
. A ScrapeSound will self-destruct when a scrape event actually ends, as announced by ClatterManager
.
Name | Type | Description | Default Value |
---|---|---|---|
loop | bool | If true, fill in silences while audio is being generated by continuously looping the current chunk of scrape audio until either there is new scrape audio or the scrape event ends. | true |
timeout | double | Timeout and destroy a Sound if it hasn't received new samples data after this many seconds. Inherited from Sound .
|
0.1 |
onCreate | Sound |
Invoked when the Sound is created. Inherited from Sound .
|
|
spatialize | bool | If true, spatialize each AudioSource. Inherited from Sound .
|
true |
Name | Type | Description | Default Value |
---|---|---|---|
onEnd | Action< int > | Invoked when the audio ends. Inherited from Sound .
|
public static T Create< T >(Samples samples, Vector3d position, int id)
Create a new sound.
Inherited from Sound
.
Name | Type | Description |
---|---|---|
samples | Samples |
The audio samples. |
position | Vector3d |
The position of the audio source. |
id | int | The audio source ID. |
public void UpdateAudio(Samples samples, Vector3d position)
Update the scrape audio.
Name | Type | Description |
---|---|---|
samples | Samples |
The new samples. |
position | Vector3d |
The new position of the sound. |
public void End()
Gracefully end the audio and prepare to self-destruct.
Inherited from Sound
.