- Home /
Video is not playing Audio
I have a Video with sound. I have attached it on a Cube to play before the Game starts.
however the audio is not playing only if i save it separately and drag it on to the cube. Than it is still out of sync.
here is the Code
function Start () {
renderer.material.mainTexture.Play();
}
function Update(){
if(!renderer.material.mainTexture.isPlaying)
Application.LoadLevel("Scene_01_Gmaeplay");
}
Help needed Please
Also, what format will the Video need to be saved out. ex: mp4 or mov or ????
Answer by aiibee · Nov 19, 2012 at 08:56 PM
Ok, I have figured out this problem that everyone is having.
its really simple.
render out your video with sound make cube or plane drag the movie onto the object with a new material assigned to it. than grab your audio and also drag it onto the object. In your inspector find "Audio Source" and just change the "Pan Level" to "0" and increase your priority Levels. after you do all this the audio will match up the Video perfectly.
If you have any other question, please feel free to leave a Comment.
function Start () {
renderer.material.mainTexture.Play();
}
function Update(){
if(!renderer.material.mainTexture.isPlaying)
Application.LoadLevel(1);
}
Code I used
Answer by Graham-Dunnett · Nov 18, 2012 at 10:58 AM
I think the following documentation page tells you pretty much everything you'll need to know.
http://docs.unity3d.com/Documentation/Components/class-MovieTexture.html
i tried all of this and it is still not playing the audio with the video. its always like 0.5 off with the Video
thanks, sorry i just started using this like 2 weeks ago. thank you for your help :)
Answer by liszto · Nov 18, 2012 at 11:05 AM
As Graham said read documentation before ask a question ^^
You can use my script to do that :
Answer by Travis1125 · Oct 26, 2015 at 12:02 PM
You can add [RequireComponent(typeof(AudioSource))]
before your C sharp class and it'll tack on the audio with the video
Your answer
Follow this Question
Related Questions
AVPro QuickTime Plugin A-V Not in Sync Problem 2 Answers
How do I sync up the video and audio from my movie? 1 Answer
Syncing separate video and audio 0 Answers
How to get perfect sync between audio and video? 0 Answers
Play VideoTexture's audio only 1 Answer