Question by
loj75 · May 26, 2021 at 11:31 AM ·
audiovideoaudiosourceaudioclip
myAudioSource.clip = videoPlayer.GetTargetAudioSource(0).clip; Can not get clip instance, myAudioSource.clip is still null. Why ?,
I use VideoPlayer to play xxx.MP4. Set audioOutputMode = AudioSource, and link it to myAudioSource. It plays as normal, but when add " myAudioSource.clip = videoPlayer.GetTargetAudioSource(0).clip; " and a Log to show it. something wrong like this : NullReferenceException: Object reference not set to an instance of an object.
Log is this:
mode: AudioSource
Vedio frameCount: 7616
NullReferenceException: Object reference not set to an instance of an object
VedioTest.Awake () (at Assets/VedioTest.cs:19)
Can someone helps?,
unity1.png
(25.4 kB)
unity3.png
(22.0 kB)
Comment
Your answer
Follow this Question
Related Questions
Cracking at end of audio? 0 Answers
Help with audio 2d 1 Answer
All my spectrums from GetSpectrumData are the same 0 Answers
What causes weird cracking/popping sound when playing 3d sound 1 Answer