Skip to content

Commit 7e3df03

Browse files
authored
fixes pitch detection mem leak (#688)
1 parent ee7255b commit 7e3df03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PitchDetection/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,16 @@ class PitchDetection {
8383
* @public
8484
*/
8585
this.results = {};
86-
const centMapping = tf.add(tf.linspace(0, 7180, 360), tf.tensor(1997.3794084376191));
86+
8787
PitchDetection.resample(event.inputBuffer, (resampled) => {
8888
tf.tidy(() => {
8989
/**
9090
* A boolean value stating whether the model instance is running or not.
9191
* @type {boolean}
9292
* @public
9393
*/
94+
const centMapping = tf.add(tf.linspace(0, 7180, 360), tf.tensor(1997.3794084376191));
95+
9496
this.running = true;
9597
const frame = tf.tensor(resampled.slice(0, 1024));
9698
const zeromean = tf.sub(frame, tf.mean(frame));

0 commit comments

Comments
 (0)