nkeenan38 / voice_activity_detector

A Voice Activity Detector rust library using the Silero VAD model.
https://crates.io/crates/voice_activity_detector
MIT License
26 stars 6 forks source link

Crate doesn't build (want to pull request) #4

Closed Unbreathable closed 8 months ago

Unbreathable commented 8 months ago

Hello, thanks for this amazing project!

I've just gotten started on developing a voice chat update for my app and thought this crate was a perfect fit. When importing it from Cargo, I got some errors though.

error[E0599]: no method named `with_model_from_memory` found for struct `SessionBuilder` in the current scope
  --> voice_activity_detector\src\vad.rs:36:14
   |
28 |           let session = Session::builder()
   |  _______________________-
29 | |             .unwrap()
30 | |             .with_optimization_level(GraphOptimizationLevel::Level3)
31 | |             .unwrap()
...  |
35 | |             .unwrap()
36 | |             .with_model_from_memory(MODEL)
   | |             -^^^^^^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `commit_from_memory`
   | |_____________|
   | 

error[E0599]: no method named `extract_tensor` found for reference `&Value` in the current scope
  --> voice_activity_detector\src\vad.rs:87:45
   |
87 |         let hn = outputs.get("hn").unwrap().extract_tensor::<f32>().unwrap();
   |                                             ^^^^^^^^^^^^^^ help: there is a method with a similar name: `try_extract_tensor`

error[E0599]: no method named `extract_tensor` found for reference `&Value` in the current scope
  --> voice_activity_detector\src\vad.rs:88:45
   |
88 |         let cn = outputs.get("cn").unwrap().extract_tensor::<f32>().unwrap();
   |                                             ^^^^^^^^^^^^^^ help: there is a method with a similar name: `try_extract_tensor`

error[E0599]: no method named `extract_tensor` found for reference `&Value` in the current scope
  --> voice_activity_detector\src\vad.rs:97:14
   |
94 |           let output = outputs
   |  ______________________-
95 | |             .get("output")
96 | |             .unwrap()
97 | |             .extract_tensor::<f32>()
   | |             -^^^^^^^^^^^^^^ help: there is a method with a similar name: `try_extract_tensor`
   | |_____________|
   | 

For more information about this error, try `rustc --explain E0599`.
error: could not compile `voice_activity_detector` (lib) due to 4 previous errors

I've already fixed them for me, but I want to contribute them back to here if you want me to do so, I mean all you really have to do is listen to Cargo here and everything will be fixed.

Let me know if I should make a pull requests, Julian.

Unbreathable commented 8 months ago

Since you literally just fixed it, this is kinda obsolete now. Anyway, thanks for your amazing library.

nkeenan38 commented 8 months ago

Hey! Thanks for the find. Just an upgrade in the ort crate, which I guess is what happens when you rely on an alpha release. And I'm sorry. I should have read your message more carefully. I missed your contribution request until now. I'd be happy to have more contributors so if there is an issue you want fixed or a feature added in the future, don't hesitate to open a PR!

Unbreathable commented 8 months ago

No problem, I'm a little new to all of this AI stuff though, so I won't exactly be able to contribute features or anything, but if you want me to I could provide an example of how to do real time voice activity detection using cpal since that's basically what the users of my app are already doing with your library. Been working great so far, we'll see how my friends like it and how it can be improved.