formantanalyzer.js icon indicating copy to clipboard operation
formantanalyzer.js copied to clipboard

Output level 2 with spec type level 1 returns 200 bins no matter what config value is set.

Open oneil512 opened this issue 2 years ago • 2 comments

When I set my config like this

      let launch_config = {
        plot_enable: false,
        spec_type: 1, //mel
        output_level: 2, //spectrum
        f_min: 0,
        f_max: 5000,
        plot_len: 16,
        min_seg_length: 10,
        N_mel_bins: 30,
        window_width: 512,
        window_step: 256,
        auto_noise_gate: false,
        voiced_min_dB: 0,
        voiced_max_dB: 80,
        pre_norm_gain: 1000,
        high_f_emph: 0.0,
      };

my callback like this

async function callback(
        seg_index,
        seg_label,
        seg_time,
        extracted_features
      ) {
        console.log("extracted_features", extracted_features);
    }

In my browser it shows there are 200 bins, not 16 like i specify in plot_len

console log below

extracted_features (200) [Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), Uint32Array(30), …]

oneil512 avatar Feb 09 '24 02:02 oneil512

I just tested it myself. It works just fine. Perhaps your script is reloading from the cache. Try clearing the cache. In the console, make sure the config is as you expect by

console.log(launch_config);

image

tabahi avatar Feb 09 '24 09:02 tabahi

I debugged it further and found that if you do not include the plot_canvas param in the launch_config then you get the issue I described

oneil512 avatar Feb 09 '24 20:02 oneil512