• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Nov 18, 2015 at 06:19 AM by Le-Pampelmuse for the following reason:

The question is answered, right answer could not be accepted because the accept button is not there. fffMalzbier gave the correct answer.

avatar image
0
Question by Le-Pampelmuse · Mar 12, 2015 at 12:01 PM · audiofilterpasslowcutoff

Unity 5: AudioLowPassfilter.cutoffFrequency not doing anything

Hello, today i have a script command for you, that doesn't work at all.

I want to change the cutoff frequency of an AudioLowPassFilter via script. It doesn't work.

It only changes if I do it manually in the inspector while the game is running.

Code:

 AudioLowPassFilter filter;
 public bool bool1;

 void Start()
 {
    filter = GameObject.Find("GameLogic").getComponent<AudioLowPassFilter>();
 }
 void Update()
 {
    if(bool1)
    {
       filter.cutoffFrequency = 5000f;
    }
    else
    {
       filter.cutoffFrequency = 100f;
    }
 }

I read in one older post that there was a bug where the value DID change, but it was not updated in the inspector.

Well, it does not work completely as of today. I'm using Unity 5.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Le-Pampelmuse · Mar 13, 2015 at 03:23 AM 0
Share

That is very very very strange. I read your comment and added:

 print(filter.cuttoffFrequency);

Into the Update function. It works now. :|

I don't know why and I certainly don't want to know :P Thanks for sharing your experience $$anonymous$$alzbier, maybe convert your comment into an answer so I can mark it as solved by that answer?

avatar image Le-Pampelmuse · Nov 11, 2015 at 08:31 PM 0
Share

Since the time I posted this question it has never happened again so I guess it was a 1:1.000.000 bug or patched in the meantime. Thank you.

1 Reply

  • Sort: 
avatar image
1

Answer by fffMalzbier · Mar 12, 2015 at 09:37 AM

I can observe that the cutoffFrequency actually changes but the inspector seems to not display the correct value at all.

You can add this to you update function to see the current value in the console log. Debug.Log (filter.cutoffFrequency);

Alternately you can set the inspector to debug mode (over the menu besides the small lock symbol) to see that the value changes. Looks like the inspector for the AudioLowPassfilter is just broken :(

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Audio Low Pass Filter Not Working 1 Answer

Where is the audio low pass rolloff curve GUI? (Unity 3) 1 Answer

Audio Analysis: isolating frequency values 1 Answer

GC lags cause sound to stutter (buffer underrun) when using OnAudioFilterRead 0 Answers

Using High Pass Filter with script 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges