Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let fileStream = new FileStream(argv.[0], FileMode.Open)
- let buffer: byte[] = Array.zeroCreate((2 * _sampleRate) / refreshFrequency)
- let streamReader = new BinaryReader(fileStream)
- timer.Elapsed.Add(fun _ ->
- let x = streamReader.Read(buffer, 0, buffer.Length)
- let bufferList = Array.toList(buffer)
- let values: float[] = ArrayFromPCM16 buffer
- let chartPoints = PointsFromArray(values, _sampleRate)
- let rTransf, cTransf = (ref null, ref null)
- let sizeNew = nextTwoPower values.Length
- let trValues = Array.zeroCreate sizeNew
- for i in 0..(values.Length-1) do
- trValues.[i] <- values.[i]
- rft.TransformForward(trValues, rTransf, cTransf)
- let transfPoints = PointsFromArray(!rTransf, 44100)
- sampleChart.newData(chartPoints)
- //sampleChart.Color <- Color.FromArgb(25 * (!counter%10), 25 * (!counter%10), 0)
- transformChart.newData(transfPoints)
- if x < buffer.Length then timer.Stop()
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement