LipSyncVolume.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    public void Start()
    {
        SetSmoothing(smoothing);
        if (useMicrophone){
            audio.playOnAwake = false;
            audio.loop = true;
            if (delay < 1) Debug.LogError ("Microphone Delay must be at least 1");
            //audio.clip = Microphone.Start("", true, delay, micSampleRate);
            if (Microphone.devices.Length > 0 && Microphone.devices.Length > micNumber){
                audio.clip = Microphone.Start(Microphone.devices[micNumber], true, delay, micSampleRate);
                //*** this is necessary or you get extreme latency problems ***
                while(Microphone.GetPosition(audio.name) <= 0);
            }
            audio.Play();
        }
    }