Coder Social home page Coder Social logo

coqui-stt's People

Contributors

7r3nzy avatar bear-03 avatar cryptex-github avatar nick-e avatar tazz4843 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

coqui-stt's Issues

Stream API issues with threads

There are a few problems. First, the threads example has been broken since 8de3237:

error[E0308]: mismatched types
  --> examples\threads.rs:54:37
   |
54 |     let stream = Stream::from_model(Arc::clone(&model)).expect("failed to create stream");
   |                  ------------------ ^^^^^^^^^^^^^^^^^^
   |                  |                  |
   |                  |                  expected `&mut Model`, found struct `Arc`
   |                  |                  help: consider mutably borrowing here: `&mut Arc::clone(&model)`
   |                  arguments to this function are incorrect
   |
   = note: expected mutable reference `&mut Model`
                         found struct `Arc<Model>`
note: associated function defined here
  --> C:\Users\jay\other-projects\coqui-stt\src\stream.rs:38:12
   |
38 |     pub fn from_model(model: &'a mut Model) -> crate::Result<Stream<'a>> {
   |            ^^^^^^^^^^

The commit fixes a UB problem, which is great, but it also creates a new one: Stream takes an exclusive reference to Model, but Model cannot outlive the stack frame without heap allocating and leaking the box.

So, i.e., this will work, but it is not ideal:

diff --git a/examples/threads.rs b/examples/threads.rs
index f592442..63edc79 100644
--- a/examples/threads.rs
+++ b/examples/threads.rs
@@ -9,7 +9,6 @@ use std::env::args;
 use std::fs::File;
 use std::path::Path;
 use std::sync::mpsc::channel;
-use std::sync::Arc;

 fn main() {
     // this is copied and pasted from the basic_usage example
@@ -40,6 +39,7 @@ fn main() {
     }

     let mut m = Model::new(model_name.to_str().expect("invalid utf-8 found in path")).unwrap();
+    let sample_rate = m.get_sample_rate();
     // enable external scorer if found in the model folder
     if let Some(scorer) = scorer_name {
         let scorer = scorer.to_str().expect("invalid utf-8 found in path");
@@ -48,10 +48,7 @@ fn main() {
     }

     // create a Stream
-    // wrap the Model in an Arc: note this makes the model immutable forever, so do any changes to its options before doing this!
-    let model = Arc::new(m);
-    // create the Stream
-    let stream = Stream::from_model(Arc::clone(&model)).expect("failed to create stream");
+    let stream = Stream::from_model(Box::leak(Box::new(m))).expect("failed to create stream");
     // you can do this construction anywhere
     // here, we'll do it in the main thread and send the stream to a background thread

@@ -76,7 +73,7 @@ fn main() {

     let src_sample_rate = desc.sample_rate();
     // keep in mind this is in an Arc, so this is immutable now
-    let dest_sample_rate = model.get_sample_rate() as u32;
+    let dest_sample_rate = sample_rate as u32;
     // Obtain the buffer of samples
     let mut audio_buf: Vec<_> = if src_sample_rate == dest_sample_rate {
         reader.samples().map(|s| s.unwrap()).collect()

Another way to do this without leaking is moving the Model into the thread first, and then creating the stream. But this does not work with the cpal API, which uses callbacks (much to my chagrin):

    // TODO: We have to leak the model to extend its lifetime to 'static.
    // It's the only way to satisfy the `coqui-stt` API with cpal callbacks.
    let mut stream = Stream::from_model(Box::leak(model)).unwrap();

    device
        .build_input_stream(
            &config,
            move |data: &[i16], _: &InputCallbackInfo| {
                stream.feed_audio(data);

                if let Ok(text) = stream.intermediate_decode() {
                    tx.try_send(text).unwrap();
                }
            },
            move |err| {
                panic!("cpal Error: {err}");
            },
        )
        .unwrap();

I should also mention yet another way to address this without leaking is with more channels. One Sender/Receiver pair for piping the cpal input stream to a thread that owns the Model and Stream. And a second channel pair to pipe the transcribed text to its final destination.

If possible, Stream could own the Model instead of borrowing.


Unfortunately, the transcription quality is not great with coqui, so I don't think we can use it. But since I noticed this issue while evaluating, I figured I would report my findings.

Can't install via `cargo install coqui-stt`

Hi there @tazz4843 ๐Ÿ‘‹

forgive my Rust ignorance:)

I was hoping to have an easy install with cargo install, but I get this error:

$ cargo install coqui-stt
    Updating crates.io index
  Downloaded coqui-stt v0.2.1
  Downloaded 1 crate (15.0 KB) in 1.74s
error: there is nothing to install in `coqui-stt v0.2.1`, because it has no binaries
`cargo install` is only for installing programs, and can't be used with libraries.
To use a library crate, add it as a dependency in a Cargo project instead.

I see what the error message, and what little I've read says this could be used as a dependency.

If it would make sense, I think it would be a great dev experience to install via a package manager like cargo

thanks for open-sourcing this btw!

how can I use this on windows?

Hi, so I get this link error
LINK : fatal error LNK1181: cannot open input file 'stt.lib'
so I guess I need to download this lib right and point to it somehow maybe ?
yes I am new to this speech tech :) and then i should have a pretrained model right?
can you please give me a step by step for speech to text using this
thank you

document install process

It looks like libcoqui-sys does not automatically grab the C library, so it would be nice to document in the README.md how and where to get it, and which version this will work with.

implement Send for Stream?

I'm not sure how Stream is supposed to be used. It doesn't implement Send. Is it really not threadsafe, or is this an oversight?

Why is static compilation impossible?

I've read in other issues that you tried to get static compilation, but in your read me you just say "static compilation is impossible". Why is it impossible?

Linker error on Linux

I'm trying to follow the examples in this repo, but I'm running into a linker error on Linux when I try to specify the path to the Coqui C libraries with LIBRARY_PATH. This is the command I'm trying to compile with;

LIBRARY_PATH=/home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux cargo build

In lib/libstt.tflite.Linux, I have the libstt.so and libkenlm.so files, but the linker error is implying that the latter cannot be found. I am very new to FFI with Rust, so any help would be appreciated! (I'm probably doing something horribly wrong.)

Linker error
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustc2LnFic/symbols.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.10rshyzrld6jstzm.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.116srme4c27q7smo.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1249i76h12307pa7.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.12p4wyu9hyxfxurw.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.15mseqft78gnbs5p.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.19rj7vm1sjcba7mc.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1avf2x3m6jd6nkzy.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1des3qtii0mh2q3y.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1e76we0yc9bmxxza.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1ja4y6o6p4ot4dhw.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1klahqfleu9mtvst.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1oy5dgr591u19yrm.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1p1rt1lgvmm2xbr7.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1q3t1ugssekcx1n6.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1r5aaa4xxul8rmsr.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.1tfkw17nmai5wd0q.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.20nbr4llmwtdtg2.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.218z4xtr8oea7n4y.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.220t20qps3b3oxtn.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.24ig1ybpoqeyd5q4.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.26osjfsbfrubhk2g.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.29agf14dectknhjj.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2a84ak9gexd3rlfz.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2cvcsppe8irbx6ou.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2e1wesmdqmv0cqd0.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2epy4opjo672rzzl.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2hd3y7z6zbts7xhu.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2hjsa7z5iyw0pq73.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2jdiv3uabkdj8h78.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2jeftygv6or57q8k.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2kd96zgoe1393dsk.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2koa14dilnq2hwy6.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2kzt90so3rv7jcq9.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2lcg5tecnjlllwee.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2m1krw09v7ld3iqt.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2pojdmt9s1csmnha.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2r5zbwpfzseeplj2.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2veccxlm868lgga7.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2w1z9t3chc06545w.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.2xw3pungndbdbgcb.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3165ksj4004rmfv.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.328moehozhmpt32a.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.32suivwwtcyb4v59.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.332o4m7fjev2zz6k.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.346b629w2nc1j6qf.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.348bnqftzktjqlee.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.34axxcsnsrwweh4x.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.38gf2rc1n6dkq6nh.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.38t6kafl3rkozqga.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3e8dcws9rw4i2u1p.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3g49cjc2ewk8um5o.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3jvn5qtkmtp6yeq1.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3murqak53gieh73.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3o492r5xtytubbh4.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3plb3lqyowamweed.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3s94ls2mbuyf2re2.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3ucd39fqn2ew19pu.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.3yim36856tqla36s.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.405ss2r9vznph5o6.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.46alkddnhh8l4pqx.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.49hmv6sjydcbgsgn.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.49w22295g2txs3ih.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4biqdfxm8pp13m8.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4buqufuryfaar3e2.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4cc5mros1u9v9vfh.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4e7np8ovp2qzfgzs.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4ngvsq4k1iekyo6q.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4nn90rnl48x5lrbb.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4oqh5zkhjxv7g3v0.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4qsfuogvwqab3kdu.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4tc8xesv97wo4gea.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4ubyre8x6nsn6ziy.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4vsa6gwsvaed00me.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.4zxib8ojp2vjflhs.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.52qwim3wiywpbexg.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.52tgfjirzg4bidwt.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5505krfl5ypt0h23.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.55rjbbakbeqp4hlo.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.58dhromu045cm38m.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5973nse9q7hpfjva.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5a45h1acriyfvgmh.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5cvphlgoh6okyq8i.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5d7n2hrzecenag1y.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5ea8fcoim2357nt2.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5exbpgrdh8grukzo.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.bqkikqip73lqn6u.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.d8vqsqf5yu5mg17.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.dcgwpq2l4otfjtt.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.iy3yz2oxbgjw9t2.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.jfqo82p6m0z4csn.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.mfbl3we1c8rbgst.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.o666oxpynn4nvi2.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.orazyyk5rx15e90.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.pgxtv3tq59yk4z4.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.qu8qis7xjop8b4p.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.s5wg7x4jlop6m99.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.trd3ahic3c749ji.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.vs5vlnpt8h5ebzx.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.xzwcc5208sr8muy.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.yvr1znupdjsvdh5.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.z4rl4u1nqinosav.rcgu.o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3.5eqv7vf2jyln0md7.rcgu.o" "-Wl,--as-needed" "-L" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps" "-L" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libdasp_signal-eb2e22fdc6289daf.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libdasp_ring_buffer-8f314b6ba0812dd5.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libdasp_interpolate-70a3610347f734b7.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libcoqui_stt-711ba86ee50cf0df.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libcoqui_stt_sys-4d071f4836874f7f.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libaudrey-219a7ca63e6b9c77.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/liblewton-91ef10af7af2eb9a.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libogg-278d6aea0a5151d8.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libsmallvec-2b7748157f9dce7b.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libmaybe_uninit-b7fac8197b96fa98.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libhound-3c5deedeaefd8ce9.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libclaxon-fa6cfe6fab0c3283.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libcaf-aaa1c2186928f7fd.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libalac-3853f26261e6ec25.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libmp4parse-0f5e38e2f964f1b7.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libnum_traits-771fbf2350708d51.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libbitreader-8938dc697ff4d10e.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libbyteorder-5b3de8b75aa468f8.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/liblog-b34c8230e35d0529.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libcfg_if-540f49c19097eeb6.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libdasp_frame-8c014054eed42c3a.rlib" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/libdasp_sample-0b0bf96f73d4a4e3.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-a11e3ca400b3ed09.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-3e82a3fced649488.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-53a4330185981bcb.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-2a8b57667b4852b5.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-9370462deca12c5a.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-7da763b8d3620472.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-5bde27582a7f5af7.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-1204e05b2d47e3d7.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-43987de2766b6923.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-d6499a0705316aa5.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c9a27c90d8fbf11e.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-8f159929cbfdfaf1.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-d2f1e8f3bb5cba95.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-9862f486269f442f.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-0434381f2f012ae2.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68549403a59fd02e.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-4cefb2045f924a5b.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-272615fc4f10c50d.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-860619b93700e7eb.rlib" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b73e5b4656934876.rlib" "-Wl,-Bdynamic" "-lstt" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/arctic-hen7/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/arctic-hen7/Coding/Clones/coqui-testing/target/debug/deps/coqui_testing-a1e6c8ee64ed6fb3" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: /usr/bin/ld: warning: libkenlm.so, needed by /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so, not found (try using -rpath or -rpath-link)
          /usr/bin/ld: /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so: undefined reference to `util::OpenReadOrThrow(char const*)'
          /usr/bin/ld: /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so: undefined reference to `lm::ngram::LoadVirtual(char const*, lm::ngram::Config const&, lm::ngram::ModelType)'
          /usr/bin/ld: /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so: undefined reference to `util::SizeFile(int)'
          /usr/bin/ld: /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so: undefined reference to `lm::ngram::Config::Config()'
          /usr/bin/ld: /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so: undefined reference to `util::scoped_fd::~scoped_fd()'
          /usr/bin/ld: /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so: undefined reference to `lm::ngram::RecognizeBinary(char const*, lm::ngram::ModelType&)'
          /usr/bin/ld: /home/arctic-hen7/Coding/Clones/coqui-testing/lib/libstt.tflite.Linux/libstt.so: undefined reference to `lm::ngram::LoadVirtual(char const*, unsigned long, lm::ngram::Config const&, lm::ngram::ModelType)'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `coqui-testing` due to previous error

Requesting More Examples

Hey, thanks for this. May we have more examples?
Particularly, streaming audio.

I can't find the threadsafe-streams feature in the crate and I want to use intermediate decode. Basically, I want to do multiple things with my audio stream. With coqui, I want to spawn a thread to do STT.

        stream.play().unwrap(); //from cpal
        streaming.feed_audio(&audio_buf_stream);
        println!("feeding audio");
        while let Ok(o) = streaming.intermediate_decode() {
            println!("{o}");
        }

I'm just getting eeeee as continuous output. Which also makes me wonder if I can transfer deepspeech models to here? Or would I have to retrain for coqui specifically since i'm getting garbage output? It's a tflite model.

I'm all over the place, but I'm just asking for an example to do speech to text in a new thread. And how would I enable threadsafe-streams feature, I can't find it

Stream isn't Send/Sync?

I noticed that Send and Sync impls were removed from Stream, with the comment that they were unsafe, however looking at the source code for libstt it doesn't seem to be doing anything that would prevent them from being Send or Sync. The closest I could find was a thread in the discussions for STT about a segfault another developer was having, but they mentioned using a mutex to fix the issue on Android, so this seems like more of an issue of improper management of shared mutable state than a fundamental lack of thread safety in Stream. Is there another reason why Stream can't be shared between threads even with proper synchronization?

MacOS supported?

I'm trying to use this library on Mac but I don't see any instructions in the ReadMe on building and running on Mac.

I used the Linux instructions and set the LIBRARY_PATH variable to the directory my libraries are in my build script and it does not seem to be working

pip install error on the basic training example

Hey-o. I was wanting to go through the basic collab example and i'm getting an error when trying to install the deps.

ERROR: Cannot install coqui-stt-training==1.0.0 and coqui-stt-training==1.4.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    coqui-stt-training 1.4.0 depends on tensorflow==1.15.4
    coqui-stt-training 1.0.0 depends on tensorflow==1.15.4

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

So i just forced reinstall with the set version
pip install 'coqui_stt_training>=1.4.0' --force-reinstall

and now another dep / python version issue.

Collecting miniaudio
  Downloading miniaudio-1.55-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (595 kB)
     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 595.6/595.6 kB 17.9 MB/s eta 0:00:00
ERROR: Ignored the following versions that require a different python version: 1.1.0 Requires-Python >=3.5, <3.8; 1.2.0 Requires-Python >=3.6, <3.8; 1.3.0 Requires-Python >=3.6, <3.8; 1.3.0a0 Requires-Python >=3.6, <3.8; 1.3.0a1 Requires-Python >=3.6, <3.8; 1.3.0a2 Requires-Python >=3.6, <3.8; 1.3.0a3 Requires-Python >=3.6, <3.8; 1.3.0a4 Requires-Python >=3.6, <3.8
ERROR: Could not find a version that satisfies the requirement tensorflow==1.15.4 (from coqui-stt-training) (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0)
ERROR: No matching distribution found for tensorflow==1.15.4

Hopefully you'll be able to update this. For now i will try to run locally. Thanks for the great project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.