public void Initialize() { this.IsPlaying = false; this.Zoom = 1f; this.PanOffset = 0f; this.beatsPerMeasureField.text = "4"; this.bpmField.text = "80"; audioEngine.Initialize(); timeSlider.Initialize(source.clip.length); trackEditor.Initialize(this, source.clip.length); minimapTrack.Initialize(this, 0); minimapTrack.InitializeWaveData(audioEngine.Samples, 1024 * 8, Color.white); trackEditor.InstantiateWaveformTrack(audioEngine.Samples, 1024, Color.yellow, "Waveform"); trackEditor.InstantiateWaveformTrack(audioEngine.BeatSamples, 1, Color.red, "Beat"); Duration = source.clip.length; // Add a blank image Image image = this.gameObject.AddComponent <Image>(); image.color = new Color(1f, 1f, 1f, 0f); image.raycastTarget = true; }
// Use this for initialization void Start() { detector = GameObject.Find("BeatDetector").GetComponent<BeatDetector>(); detector.Initialize(audio.clip); detector.SynchAndPlay(audio); }
// Use this for initialization void Start() { detector = GameObject.Find("BeatDetector").GetComponent <BeatDetector>(); detector.Initialize(audio.clip); detector.SynchAndPlay(audio); }
// Use this for initialization void Start() { _playedAudio = GameObject.Find("TrackPlayer").GetComponent <AudioSource>(); _beatDetector = GetComponent <BeatDetector>(); _beatDetector.Initialize(_playedAudio.clip); _beatDetector.SynchAndPlay(GameObject.Find("TrackPlayer").audio); }
// Use this for initialization void Start() { _playedAudio = GameObject.Find("TrackPlayer").GetComponent<AudioSource>(); _beatDetector = GetComponent<BeatDetector>(); _beatDetector.Initialize( _playedAudio.clip ); _beatDetector.SynchAndPlay(GameObject.Find("TrackPlayer").audio); }