formantanalyzer.js
formantanalyzer.js copied to clipboard
Output level 2 with spec type level 1 returns 200 bins no matter what config value is set.
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), …]
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);
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