jaxcore / bumblebee-hotword-node

BumbleBee Hotword for NodeJS
Apache License 2.0
14 stars 4 forks source link

[ERROR] sensitivity should be within [0, 1] when starting after stopping #9

Open ncpleslie opened 4 years ago

ncpleslie commented 4 years ago

I'm receiving the following error:

[ERROR] sensitivity should be within [0, 1]

This error occurs when I restart the bumblebee service after stopping it.

For example, my current code is:

this.bumblebee.start();

this.bumblebee.on('hotword', ()=> {

    this.bumblebee.stop();

    this.emit('bumblebee');

});

The previously stated code is in a function that is recalled at a later date. The bumblebee code is initialized in the constructor:

    if (!this._bumble) {

        this.bumblebee = new BumbleBee({

            device: SystemConstants.getAudioDevice(),

            program: RecordingProgram.ARecord

        });

        this.bumblebee.addHotword('bumblebee');

        this.bumblebee.setSensitivity(0.8);

    }

Any clue why this error happens?

dsteinman commented 3 years ago

Sorry, I've been neglecting this project somewhat and just saw this now. Yes I think I have seen this error, I think it was something in the Porcupine .wasm code. I've typically just been avoiding the whole problem by never stopping bumblebee. Depending on how you're sending the audio data in, you can accomplish mute functionality by just not feeding bumblebee any audio data.