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
0
Question by RoelfMik · Apr 15, 2015 at 01:54 PM · unity 5audio

How do I get to the AudioMixerSnapshots of a cloned AudioMixer?

When I apply AudioMixer.FindSnapshot() to a cloned AudioMixer, it wil return the Snapshots of the original AudioMixer rather than the cloned one.

I want to interpolate the Snapshots of the cloned AudioMixer using AudioMixer.TransitionToSnapshots(), but I can't get a reference to the cloned AudioMixer's Snapshots.

Does anybody have any ideas as to how to solve this? Any help is very, very much appreciated! Here's a simple test project illustrating the problem: https://drive.google.com/file/d/0B4PGrnbx86xCR3hkM1FSc29wQ3c/view?usp=sharing

Here's some code:

 using System.Collections;
 
 public class Cloning_Problem : MonoBehaviour 
 {
 
     public AudioMixer _AudioMixer;
     public AudioMixer _AudioMixer_Clone; 
 
     public AudioMixerSnapshot[] _Snapshot; 
     public float[] _Weight;
 
     void Start() 
     {
 
         _AudioMixer_Clone = Instantiate(_AudioMixer);
 
         _Snapshot = new AudioMixerSnapshot[3];
 
         //This returns the Snapshots of _AudioMixer, instead of _AudioMixer_Clone...
         _Snapshot[0] = _AudioMixer_Clone.FindSnapshot("A");
         _Snapshot[1] = _AudioMixer_Clone.FindSnapshot("B");
         _Snapshot[2] = _AudioMixer_Clone.FindSnapshot("C");
 
         _Weight = new float[3];
 
         _Weight[0] = 0.2f;
         _Weight[1] = 0.4f;
         _Weight[2] = 0.4f;
 
         //Which results in this method failing, because it cant find the Snapshots on the _AudioMixer_Clone...
         _AudioMixer_Clone.TransitionToSnapshots(_Snapshot, _Weight, 0.1f);
 
     }
 
 }
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

0 Replies

· Add your reply
  • Sort: 

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

18 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

Related Questions

In-game sound turns off when I play 0 Answers

Audio/c#/unity Can i control the duration by time ? 1 Answer

Background Music control issues 0 Answers

No sound in Unity on Linux, but sound works in built game 1 Answer

Will there be an event system in the new audio in Unity 5 1 Answer


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