comparison src/app/spectrogram/Spectrogram.ts @ 497:c39df81c4dae

Upgrade to released piper version, which had a lot of breaking changes due to shifting modules around and renaming.
author Lucas Thompson <dev@lucas.im>
date Sun, 13 Aug 2017 19:44:07 +0100
parents 6a83df5029fe
children
comparison
equal deleted inserted replaced
496:3c962af5342c 497:c39df81c4dae
1 /** 1 /**
2 * Created by lucast on 16/03/2017. 2 * Created by lucast on 16/03/2017.
3 */ 3 */
4 import {RealFft, KissRealFft} from 'piper/fft/RealFft'; 4 import {RealFft, KissRealFft, hann} from 'piper-js/fft';
5 import {hann} from 'piper/FftUtilities'; 5 import {KissFft} from 'piper-js/fft/KissFftModule';
6 import {Framing} from 'piper'; 6 import {Framing} from 'piper-js/core';
7 import Waves from 'waves-ui-piper'; 7 import Waves from 'waves-ui-piper';
8 8
9 class SpectrogramEntity extends Waves.utils.MatrixEntity { 9 class SpectrogramEntity extends Waves.utils.MatrixEntity {
10 10
11 private samples: Float32Array; 11 private samples: Float32Array;
23 this.sampleRate = sampleRate; 23 this.sampleRate = sampleRate;
24 this.framing = options; 24 this.framing = options;
25 this.real = new Float32Array(this.framing.blockSize); 25 this.real = new Float32Array(this.framing.blockSize);
26 this.nCols = Math.floor(this.samples.length / this.framing.stepSize); // !!! not correct 26 this.nCols = Math.floor(this.samples.length / this.framing.stepSize); // !!! not correct
27 this.columnHeight = Math.round(this.framing.blockSize / 2) + 1; 27 this.columnHeight = Math.round(this.framing.blockSize / 2) + 1;
28 this.fft = new KissRealFft(this.framing.blockSize); 28 this.fft = new KissRealFft(this.framing.blockSize, KissFft);
29 this.window = hann(this.framing.blockSize); 29 this.window = hann(this.framing.blockSize);
30 } 30 }
31 31
32 dispose(): void { 32 dispose(): void {
33 this.fft.dispose(); 33 this.fft.dispose();