Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Audio How to load an Audio SnapShot at runtime?

Discussion in 'Audio & Video' started by KarlKarl2000, Dec 6, 2018.

  1. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    I'm curious if its possible to load an audio snapshot rather than dragging it in via inspector

    I have the audiomixer in the Resources folder but neither of these work

    Code (CSharp):
    1. void Start()
    2. {
    3.        _snapShot = Resources.Load<AudioMixerSnapshot>("Audio/ElevatorMusicSnapShot");
    4.  
    5.        _snapShot = Resources.Load<AudioMixerSnapshot>"Audio/MasterMusicAudioMixer/ElevatorMusicSnapShot");
    6.  
    7. }
    8.  
    Anyone have any ideas\ suggestions?

    Thanks!
     
  2. JLF

    JLF

    Joined:
    Feb 25, 2013
    Posts:
    139