Table of Contents

Class PuddlecraftAudio

Namespace
DFA.Puddlecraft

The sound of the rain: procedural rain built from ten crossfading frequency bands that follow the intensity, plus drips landing and spouts pouring. Add one per scene.

Where the audio listener is inside a CoverVolume, the rain is muffled and drips and spouts play quieter. Place volumes wherever the rain should sound sheltered, such as indoors.

[DisallowMultipleComponent]
[AddComponentMenu("Puddlecraft/Puddlecraft Audio")]
[Icon("Packages/com.dfa.puddlecraft/editor/icons/puddlecraft.png")]
public sealed class PuddlecraftAudio : MonoBehaviour
Inheritance
PuddlecraftAudio

Properties

dripClips

Clips for drips landing, on any surface. One is picked at random for each drip, at a random pitch (0.9 to 1.12) and 60 to 100% of dripVolume.

public AudioClip[] dripClips { get; set; }

Property Value

AudioClip[]

dripDistance

Drips farther than this from the listener aren't played, in metres (at least 1). Spouts are heard up to 1.5 times as far.

public float dripDistance { get; set; }

Property Value

float

dripVolume

Volume of the drips, 0 to 1. With the listener under full cover they play at 40% of it.

public float dripVolume { get; set; }

Property Value

float

exposure

How exposed the listener is to the rain, from 0 (fully under cover) to 1 (out in the open), smoothed. It is 1 minus the cover of the Cover Volumes the listener is in.

public float exposure { get; }

Property Value

float

levelFade

Seconds (0.05 to 5) for the rain's band levels to follow a change in intensity or cover.

public float levelFade { get; set; }

Property Value

float

maxDripsPerSecond

Most drips played per second (1 to 60), however many land.

public int maxDripsPerSecond { get; set; }

Property Value

int

output

Mixer group for every Puddlecraft sound, or null for the default output.

public AudioMixerGroup output { get; set; }

Property Value

AudioMixerGroup

rain

The rain's bands and preset curves. Change the curves to reshape the rain.

public RainSoundscape rain { get; }

Property Value

RainSoundscape

rainVolume

Volume of the rain, 0 to 1.

public float rainVolume { get; set; }

Property Value

float

spoutStream

The loop played where each spout's stream lands. Wider spouts play it lower and louder.

public AudioClip spoutStream { get; set; }

Property Value

AudioClip

spoutVolume

Volume of the spouts, 0 to 1. Each spout also follows its flow and width, and with the listener under full cover plays at 40% of it.

public float spoutVolume { get; set; }

Property Value

float