Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Access Audio Track Volume

Discussion in 'Timeline' started by mutafikah, Jul 24, 2018.

  1. mutafikah

    mutafikah

    Joined:
    Jul 3, 2018
    Posts:
    5
    I have an audio track on a timeline. I'd like to be able to change the volume of this track by code. I've tried accessing the volume of the audiosource which is attached to it, but this doesn't change the timeline's volume. Is there a way to access the volume of a timeline audio track?

    Thanks!
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,068
    No, but it's something we are looking to add soon.
     
    FURKANKAHVECI and mutafikah like this.
  3. FURKANKAHVECI

    FURKANKAHVECI

    Joined:
    May 12, 2013
    Posts:
    14
    2019.1 ?
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,068
    Volume in 2019.1, animated volume in 2019.2.
     
    FURKANKAHVECI likes this.
  5. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    299
    I have taken look at AudioTrack, but still cannot find volume accessor/setter. Using Unity 2019.2.8
     
  6. ewanuno

    ewanuno

    Joined:
    May 11, 2017
    Posts:
    39
    assign an Audiosource to the Audiotrack, then control the volume of that Audiosource, either directly or via a mixer.
     
  7. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,068
    The volume can be accessed from the inspector, or from the the curve editor. If you select a clip, you can edit the volume in the inspector (but it is not animated, except for using ease/blend in/out).

    upload_2019-10-24_8-17-30.png