SoundParameterIntensity

A parameter which can control multiple aspects of the sound through code

SoundParameterIntensity

SoundParameterIntensity is used to pass an intensity value to a SoundContainer when playing a SoundEvent. This value can be anything you want to affect your sound, e.g. velocity, the size of an explosion, the speed of a car, etc. The SoundContainer can scale and use the intensity parameter to control intensity options e.g. volume, pitch, distortion etc.

circle-info

❕ Tip: You can record and debug the intensity at the Intensity in the SoundEvent.

Oneshot Intensity - Physics Impacts

Example code:

using UnityEngine;
using Sonity;

public class ExampleIntensityParameterCollision: MonoBehaviour {

    public SoundEvent soundImpact;
    private SoundParameterIntensity soundIntensityParameter = new SoundParameterIntensity(1f, UpdateMode.Once);

    void OnCollisionEnter(Collision collision) {
        // Sets the intensity parameter to the velocity of the collision
        soundIntensityParameter.Intensity = collision.relativeVelocity.magnitude;

        // Plays the SoundEvent with the intensity parameter
        soundImpact.Play(transform, soundIntensityParameter);
    }
}

Physics Impact - SoundContainer

The velocity of the impact is passed once as an intensity parameter which controls the intensity volume and intensity lowpass filter of the SoundContainer. (Check out the SoundPhysics component for easily playing physics sounds)

For volume intensity you can crossfade between any number of layers (eg. hard/medium/soft) easily and accurately.

The default settings of the lowpass filter intensity settings make the sound more filtered the lower the intensity value is. E.g. 0 intensity is maximum filter effect and 1 intensity is unfiltered.

Continuous Intensity - Car Engine

Example code:

Car Engine - SoundContainer

The speed of the car is passed as an continuous intensity parameter which controls the intensity pitch and volume of the SoundContainerarrow-up-right.

Last updated