Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
avatar image
1
Question by CinnoMan · Feb 12, 2016 at 09:31 PM · audioeffectsmixing

How to bypass audio effects from script? (AudioMixer)

For my game, I intend to make heavy use of audio effects in Unity 5's AudioMixer. I understand how to expose parameters to control them from script.

But how do I bypass audio effects from script (to conserve cpu)? There seems to be no "enabled" property or parameter that I could set in the inspector, where other exposable parameters show up. There is only the toggle button in the mixer view itself.

Surely it's possible to do that from script?

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by SoftAnswers · Feb 13, 2016 at 03:31 AM

your AudioSourceGameobject.SetActive(true/false);

Comment
Add comment · Show 1 · 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
avatar image CinnoMan · Mar 10, 2018 at 08:44 AM 0
Share

Weirdly, I've only seen this more than 2 years later.... :D

I'm constantly routing multiple audio sources to a mixer channel and want to still use the channel, but sometimes disable its audio effects. setting the AudioSource to inactive won't achieve what I want, unfortunately.

avatar image
0

Answer by moff84 · Mar 08, 2018 at 07:32 PM

Use snapshots. Have one with the effect on and one with it off. You can script to transitionTo another snapshot

Comment
Add comment · Show 1 · 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
avatar image CinnoMan · Mar 10, 2018 at 08:51 AM 0
Share

Thank you for your answer.

However, snapshots are not the solution for my use case. They are great when you have a handful of configurations you want to switch between, but with the granular changes I'm making all the time, that would be very messy and error-prone to solve with snapshots.

I guess I could create a sub mixer per channel as a workaround, is that what you meant? But that is also quite clunky and just seems like overkill. I don't quite understand what criteria they used to deter$$anonymous$$e which mixer parameters were to be exposable and which weren't...

avatar image
0

Answer by DerLasseHenrich · Sep 23, 2019 at 09:31 PM

You can say audioSource.outputAudioMixerGroup = null. To enable that mixer later, simply assign it again.

Comment
Add comment · Show 2 · 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
avatar image CinnoMan · Sep 24, 2019 at 01:04 PM 0
Share

Thank you for the suggestion. If it were just a single track where I want to "switch on/off" a single audio effect, I guess that would be a good work-around. However, I'd like to do so with multiple tracks and, more importantly, switch various effects on a channel on and off from code, so if there's two audio effects, that would already mean creating 4 different audio mixers for the various constellations, while also managing their snapshots etc. Sounds like a hard to maintain mess.

It's baffling the obvious simple solution of being able to enable/disable audio effects from code is still not possible 3 and half years later....

avatar image DerLasseHenrich CinnoMan · Sep 24, 2019 at 07:12 PM 0
Share

I see, yeah that's really annoying.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

39 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get mixer volume level in DB and RMS ? 1 Answer

Audio Mixer Duck Volume no Input signal 0 Answers

Chain multiple effects in OnAudioFilterRead 0 Answers

Audio Distortion effects? 0 Answers

How to route sound from PlayClipAtPoint() to a specific audio mixer group? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges