Legacy Documentation: Version 5.6 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AudioLowPassFilter.cutoffFrequency

Switch to Manual
public float cutoffFrequency;

Description

Lowpass cutoff frequency in hz. 10.0 to 22000.0. Default = 5000.0.

Note that setting this value will reset any custom cutoff curve set for this AudioLowPassFilter.

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(AudioSource))] [RequireComponent(typeof(AudioLowPassFilter))] public class ExampleClass : MonoBehaviour { void Update() { GetComponent<AudioLowPassFilter>().cutoffFrequency = Mathf.Sin(Time.time) * 11010 + 11000; } }