Created
November 9, 2015 07:42
-
-
Save mohayonao/98bd3eb358785eeb97ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function convertIRtoAR(self, numOfSamples) { | |
| let value = self.value; | |
| let result = new Float32Array(numOfSamples); | |
| for (let i = 0, imax = result.length; i < imax; i++) { | |
| result[i] = value; | |
| } | |
| return result; | |
| } | |
| function convertKRtoAR(self, numOfSamples) { | |
| let prevValue = self.prevValue; | |
| let nextValue = self.value; | |
| let result = new Float32Array(numOfSamples); | |
| let value = prevValue; | |
| let step = (nextValue - prevValue) / result.length; | |
| for (let i = 0, imax = resut.length; i < imax; i++) { | |
| result[i] = value; | |
| value += stepValue; | |
| } | |
| self.prevValue = nextValue; | |
| return result; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment