My plain is to have an always playing PlayableGraph with one master AudioMixer. The output then set its source playable to this master mixer. (SetSourcePlayable(mixer)) To live-add an audio to the mix, I planned to dynamically add more AudioClipPlayable to this mixer while the graph is playing.
However I want some kind of logic before it so I made AudioObjectPlayableBehaviour. (An example is that when it detects the clip is done, then it destroy itself from the graph, or unloads audio clip, or reset time and repeat with a new audio clip, etc.)
In both case it works as intended, but I donât understand :
- Why the mixer could âmix my scriptâ and understand that it should mix the AudioClipPlayable behind it? The mixer is usually connected to an another AudioMixerPlayable or AudioClipPlayable.
- Why when I set my scriptâs
SetTraversalMode(PlayableTraversalMode.Passthrough);then I cannot hear an audio anymore? From enumâs description, it sounds like this should be what allowed me to hear the audio (so it passthrough, not blocking the mixer and the actual clip) but turns out setting it disconnect the âdata flowâ? - Is the
output.SetSourcePlayable(playable)overload without port, meant port 0? Or does that means all ports? Why when I set it explicitly to port 1, the case where there are 3 branches I could still hear the mixed result? It is supposed to cause the output to only evaluate a specific sub branch from the documentation. I look at the TimelinePlayable code and see that it creates an output for each track, which each output use SetSourcePlayable(timelinePlayabe,x) to the same root timeline playable, but with explicit port number so that the output only works with a sub branch of that. That goes according to my understanding, but not in my own graph/branches. Why is it different?
My questions above is required to solve this next problem. Now I donât want to just plug in an audio clip, I want to plug in a playable created from TimelineAsset with audio tracks. So I manually call .CreatePlayable on the TimelineAsset in my own graph (with an output already, so it didnât create output per track anymore) then because I know all tracks are audio tracks, I mimic ILayerable by creating one more AudioMixerPlayable to sum them all up with full weight, and so a single output should be able to receive the audio. I understand that I cannot remove TimelinePlayable as it is the brain that activates the subgraph representing clips according to time interval, so that has to stand in-between the output and the audio.

So I use the same reasoning, I want some custom logic in front of Timeline as that blue node (when it ends, remove itself, etc.) However in the graph above I cannot hear any audio. I expect the data to flow through somehow like the first case where my script is blocking the output, but now it didnât happen anymore. I want to know why?
I notice that the Timeline has Passthrough set in the source code, so I think that maybe what my script is missing and I tried on my blue node. The result didnât change as I still cannot hear anything, plus it make the simpler case above broken as mentioned before. So I think I need some explanation why exactly Passthrough is needed on the TimelinePlayable, and how to solve this data path problem.
Next I tried to remove just my script and reconnect so that there is only master mixer in the way. Output is still connecting to the same master mixer with no explicit port argument (or 0). I still canât hear anything. Why just the TimelinePlayable could block the audio still? You can see the output still cause an entire graph to be evaluated because TimelinePlayableâs time goes forward and its interval logic works.

Finally, this is how I get it to work. So it is just like how Timeline do it to a single track. But I lose my custom script playable and my master mixer (which I planned it to sum up many sub-audio-timeline and simpler audio clips to one output) in the process. So I would like to know how to properly ârelayâ the data through obstacle to the output. Thank you.



