Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
3
Question by Piflik · Mar 31, 2015 at 09:37 AM · audiooutput

AudioMixer output volume

Is it somehow possible to access an AudioMixer's output level via Script?

alt text

mixer.jpg (7.9 kB)
Comment
Add comment · Show 3
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 probitaille · Jul 13, 2015 at 04:14 PM 0
Share

Hey! I'm searching the same thing. Did you found how? The only way I know is getting the outputData from audioSource...

avatar image Nirvan · Jan 14, 2017 at 09:07 PM 0
Share

I need it too and can't find answer :(

avatar image MrFuzzzy · May 28, 2020 at 10:14 AM 0
Share

is there really no answer to this after 5 years?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by OndrejP · Jun 13, 2020 at 11:17 AM

1. In editor

Call this method by reflection:

 // UnityEditor.Audio.AudioMixerController
 internal sealed class AudioMixerController : AudioMixer
 {
     public int GetGroupVUInfo(GUID group, bool fader, float[] vuLevel, float[] vuPeak);
 }

vuLevel and vuPeak are 9-element arrays which get these values - one element per channel


2. At runtime by OnAudioFilterRead

Works only on the level of AudioListener (all sounds) or AudioSource (single sound), no support for mixers or groups

This is better method than 3., because it's called directly from Audio thread and gives you data at appropriate time

 public class AudioFilterMeasureVolume : MonoBehaviour
 {
     private void OnAudioFilterRead(float[] data, int channels)
     {
         // Process data
     }
 }

Process the data like this:

https://answers.unity.com/questions/165729/editing-height-relative-to-audio-levels.html


3. At runtime by AudioListener

Works only for master output data, cannot get data for individual mixers or groups

Call AudioListener.GetOutputData and process the data like this: https://answers.unity.com/questions/165729/editing-height-relative-to-audio-levels.html


4. At runtime by Native Audio Plugin SDK

It's possible to write native audio plugin, which will extract this information: https://docs.unity3d.com/Manual/AudioMixerNativeAudioPlugin.html

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

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

23 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

Related Questions

Unity Audio Output Data 0 Answers

How can I set the audio on a Virtual Reality game? 0 Answers

Change AudioSource output via Script 1 Answer

AudioSource.GetOutputData obsolete 2 Answers

5.1 Channels is backwards in unity (non 3D) 0 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