public LipSyncRuntimeRecognizer(ERecognizerLanguage recognizingLanguage, int windowSize, float amplitudeThreshold) { this.recognizingLanguage = recognizingLanguage; this.windowSize = Mathf.ClosestPowerOfTwo(windowSize); this.playingAudioData = new float[this.windowSize]; this.playingAudioSpectrum = new float[this.windowSize]; this.amplitudeThreshold = amplitudeThreshold; this.gaussianFilter = MathToolBox.GenerateGaussianFilter(FILTER_SIZE, FILTER_DEVIATION_SQUARE); this.smoothedAudioSpectrum = new float[this.windowSize]; this.peakValues = new float[FORMANT_COUNT]; this.peakPositions = new int[FORMANT_COUNT]; this.formantArray = new float[FORMANT_COUNT]; }
public LipSyncOfflineRecognizer(ERecognizerLanguage recognizingLanguage, float amplitudeThreshold, int windowSize, int shiftStepSize) { this.recognizingLanguage = recognizingLanguage; this.windowSize = Mathf.ClosestPowerOfTwo(windowSize); this.shiftStepSize = shiftStepSize; this.amplitudeThreshold = amplitudeThreshold; this.gaussianFilter = MathToolBox.GenerateGaussianFilter(FILTER_SIZE, FILTER_DEVIATION_SQUARE); this.windowArray = MathToolBox.GenerateWindow(windowSize, MathToolBox.EWindowType.Hamming); this.smoothedAudioSpectrum = new float[this.windowSize]; this.peakValues = new float[FORMANT_COUNT]; this.peakPositions = new int[FORMANT_COUNT]; this.formantArray = new float[FORMANT_COUNT]; }