Infoserv-Systems-Ltd / silero-rs

Rust bindings for silero's cpp wrapper
0 stars 0 forks source link

Make threshold and return type configureable #8

Open Oliver-Pikett opened 2 months ago

Oliver-Pikett commented 2 months ago

make an option for whether the user wants the output to be in the form of booleans or probabilities and for the voice activation threshold when making a session.

SeanEClarke commented 2 months ago

A better approach would be to return a struct (I was going to raise a ticket for this) - something like:

(pseudo code - won't compile, but a good starter)

struct VADResult {
start_period:  0
end_period:   1000
confidence:     0.7856
voice_detect:  true
}

so usage would look something like....

let my_vad = Silero::init( /* whatever params to initialise */);

let result = my_vad.detect(&some_array_with_1_second_of_audio);

println!("confidence: {}, detect_result: {}", resul.confidence, result.voice_detect);

I think that's on its way to be coming a very usable API