- Home /
How do I sync up the video and audio from my movie?
Hi guys, I'm trying to play a .avi video in unity which I have put on a plane and it's working fine but the audio is a few seconds out of sync with the video which makes it unbearable to watch. Does anyone know how to sync up video and audio so that it plays at the same time?
using UnityEngine;
using System.Collections;
[RequireComponent (typeof(AudioSource))]
public class PlayVideo : MonoBehaviour {
// Use this for initialization
void OnMouseUp(){
MovieTexture PL1 = renderer.material.mainTexture as MovieTexture;
audio.clip = PL1.audioClip;
audio.Play();
PL1.Play ();
}
// Update is called once per frame
void Update () {
}
}
This isn't an answer to your question but it might work for you.
I noticed you just found out how to play a movie based on another question.
Try this method rather than the one you are using, might work better. http://www.youtube.com/watch?v=-vd9$$anonymous$$db2r34
You are correct, but the tutorial in the YouTube video displays both video and plays sound. The guy's cube that he makes plays the video and plays the sound. Therefore if you use his method you won't have a sound problem.
it didn't work but I found another work around, thanks anyway
Hi i'm having the same issue, can you tell me which workaround have you found to sync up audio and video? Thank you
Your answer
Follow this Question
Related Questions
Syncing separate video and audio 0 Answers
AudioClip sync across a network: help needed! 0 Answers
How to get perfect sync between audio and video? 0 Answers
AVPro QuickTime Plugin A-V Not in Sync Problem 2 Answers
Video is not playing Audio 4 Answers