// Update is called once per frame public void ReadUpdate() { LipSyncReading = AutoExperimentInstruction.Reading; LipSyncAudioSource = GetComponent <AudioSource>(); LipSyncAudioData = GetComponent <LipSync>(); AutoEnable = GetComponent <EnableLipsync>(); infoClip = LipSyncAudio; infoData = LipSyncAudioDataSpeaker; AutoEnable.enabled = false; LipSyncReading = AutoExperimentInstruction.Reading; if (LipSyncReading) { LipSyncAudioData.defaultClip = infoData; LipSyncAudioSource.clip = infoClip; LipSyncAudioData.Play(infoData); LipSyncAudioSource.Play(); } else { LipSyncAudio = null; LipSyncAudioData = null; AutoEnable.enabled = false; } }
// Start is called before the first frame update void Start() { LipSyncReading = AutoExperimentInstruction.Reading; LipSyncAudioSource = GetComponent <AudioSource>(); LipSyncAudioData = GetComponent <LipSync>(); AutoEnable = GetComponent <EnableLipsync>(); infoClip = LipSyncAudio; infoData = LipSyncAudioDataSpeaker; // AutoEnable.enabled = false; }