Search Unity

Playing AudioClips from an AudioTrack doesn't trigger IsPlaying()

Discussion in 'Timeline' started by _Shade, Oct 29, 2018.

  1. _Shade

    _Shade

    Joined:
    Dec 9, 2014
    Posts:
    5
    Hey folks,

    I am using Unity's Timeline to play AudioClip using the AudioTrack for a sequence in my game:
    upload_2018-10-29_15-24-2.png
    NOTE: This is a heavily simplified timeline to show you how my AudioTrack is setup

    Apparently, playing an audio clip this way doesn't trigger IsPlaying() for that AudioSource which I am using for other functionalities of the game.

    Is this a bug or did I do something wrong here?
    Is there a way for me to grab information on whether or not the AudioSource is playing the clip when it is being played via the timeline?

    Thanks,
    Shade
     
    Last edited: Oct 29, 2018
  2. simonejennings

    simonejennings

    Joined:
    Jan 11, 2017
    Posts:
    13
    I've also had this issue, have you found an answer to this?
     
  3. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    The reason it doesn't return true is the audio source isn't the actual objecting playing the clip. The transform and some of the settings from the audio source (mixer, volume, etc..) are used by the timeline to play the clip(s).

    Maybe isPlaying should still return true though, it's quite a good question :)

    But to answer the real question, I don't believe there is a way to detect if the audio source is currently being used by a timeline.