A simple, yet feature-filled wrapper around the coqui-stt C API

Overview

coqui-stt

Docs: https://docs.rs/coqui-stt/latest/coqui_stt

crates.io: https://crates.io/crates/coqui-stt

Github: https://github.com/tazz4843/coqui-stt

A simple, yet feature-filled wrapper around the coqui-stt C API.

Handles all low-level things for you. All you need to worry about is passing in a valid model, optionally scorer, and audio.

If you'd like to, audio streaming is supported with the Stream class.

You can gain extended metadata about an audio result with the Metadata class.

Some hidden functions are also exposed in the Rust API with #[doc(hidden)].

MSRV

The MSRV is always the latest stable version, currently 1.58.1 (2022-01-20) as of this writing.

Comments
  • how can I use this on windows?

    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

    opened by The-Mr-L 21
  • Fix windows-specific issues

    Fix windows-specific issues

    This PR goes in tandem with this one in coqui-stt-sys to fix the same issues.

    In that PR, new link attributes were added, so adding them manually in build.rs is not needed anymore.

    Also, instead of adding C:\stt to the library search paths manually in build.rs, the same effect can be achieved by adding a library folder to the PATH env variable, which is the common solution to having global libraries on windows. If the developer doesn't want to change path, they can always create their own build.rs and add their own library search directory.

    Lastly, as mentioned in the coqui-stt-sys PR, some bindings are not available on windows, so their high-level equivalents should also be removed.

    opened by Bear-03 7
  • document install process

    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.

    opened by droundy 4
  • Can't install via `cargo install coqui-stt`

    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!

    opened by JRMeyer 4
  • Requesting More Examples

    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

    opened by jackpeters667 3
  • Why is static compilation impossible?

    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?

    opened by Techno-Fox 2
  • Stream isn't Send/Sync?

    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?

    opened by goose121 2
  • fix type conversion

    fix type conversion

    coqui-stt could not be compiled for the target armv7-unknown-linux-gnueabihf because STT_CreateModelFromBuffer requires an argument whose type is std::os::raw::c_char which is not i8 on the previously mentioned target. Casting the argument to std::os::raw::c_char before passing it will make the library more os-agnostic.

    opened by nick-e 0
Owner
0/0
person who writes crappy code that sometimes gets popular they/them
0/0
A safe wrapper around Gamercade's raw Api.

gamercade-rs A safe wrapper around Gamercade's Raw Api. As the Raw Api requires using a lot of unsafe and hiding of values through different types (fo

null 1 Aug 23, 2022
Thin wrapper around starship.rs to format kakoune status line

kakship is just a thin wrapper around starship to format the status line of kakoune and is meant to be used with the included kakoune script kakship.kak.

Eric Burghard 15 Jun 7, 2022
FFI wrapper around cfitsio in Rust

rust-fitsio FFI wrapper around cfitsio in Rust Installation fitsio supports versions of cfitsio >= 3.08. cfitsio must be compiled with reentrant suppo

Simon Walker 22 Dec 24, 2022
cargo-check This is a wrapper around cargo rustc

cargo-check This is a wrapper around cargo rustc -- -Zno-trans. It can be helpful for running a faster compile if you only need correctness checks. In

Ray Solomon 99 Oct 13, 2022
🌋 A very lightweight wrapper around the Vulkan Memory Allocator 🦀

?? vk-mem-alloc-rs A very lightweight wrapper around the Vulkan Memory Allocator ?? [dependencies] vk-mem-alloc = "0.1.1" Simple Vulkan Memory Allocat

Project KML 13 Nov 8, 2022
API wrapper for the tankerkönig api

tankerkoenig-rs API wrapper for the tankerkoenig-api written in rust. Gives you ready deserialized structs and a easy to use and strictly typed api. I

Jonathan 2 Feb 27, 2022
A simple, fast and fully-typed JSPaste API wrapper for Rust

rspaste A simple, fast and fully-typed JSPaste API wrapper for Rust. aidak.tk » Installation Put the desired version of the crate into the dependencie

Aidak 2 May 17, 2022
A high-level Rust crate around the Discord API, aimed to be easy and straight-forward to use.

rs-cord A high-level Rust crate around the Discord API, aimed to be easy and straight-forward to use. Documentation • Crates.io • Discord Navigation M

Jay3332 4 Sep 24, 2022
A simple library with just one struct which is used to wrap around pointers

A simple library with just one struct which is used to wrap around pointers. This can be used to create pointers and share them across threads without the hassle of synchronization if you really do not care about that.

null 1 Apr 11, 2022
Autorebase automatically rebases all of your feature branches onto master.

Autorebase automatically rebases all of your feature branches onto master. If conflicts are found it will rebase to the last commit that doesn't cause conflicts. By default, branches with an upstream are excluded. You don't need to switch to any branch, the only limitation is that a branch that is checked out and not clean will not be rebased (though I may add that in future).

Tim 66 Nov 26, 2022
Document your crate's feature flags

Document your crate's feature flags This crate provides a macro that extracts documentation comments from Cargo.toml To use this crate, add #![doc = d

SixtyFPS 83 Dec 15, 2022
A rust wrapper for the spam protection API

SpamProtection-rs Table of contents About Supported Rust version Features How to use Credits License About This repo has been shifted to the official

cyberknight777 28 Aug 5, 2022
A Rust wrapper for the SponsorBlock API.

sponsor-block A Rust wrapper for the SponsorBlock API, which you can find complete documentation for here. Uses SponsorBlock data licensed under CC BY

Zacchary Dempsey-Plante 8 Nov 19, 2022
Wrapper library for utilizing DigitalOcean API v2 in Rust

doapi-rs Wrapper library for utilizing DigitalOcean API v2 in Rust Disclaimer This library is in alpha - it may do anything up to, and including, eati

Kevin K. 30 Nov 5, 2022
Autogenerated wrapper for the Telegram Bot API written in Rust.

An Elegant Rust Client for Telegram Bot API crates.io • docs.rs Table of contents Introduction Key Features Installation Getting Started Documentation

FerrisGram 22 Oct 29, 2022
Modrinth API is a simple library for using, you guessed it, the Modrinth API in Rust projects

Modrinth API is a simple library for using, you guessed it, the Modrinth API in Rust projects. It uses reqwest as its HTTP(S) client and deserialises responses to typed structs using serde.

null 21 Jan 1, 2023
Yet another ROS2 client library written in Rust

RclRust Target CI Status Document Foxy (Ubuntu 20.04) Introduction This is yet another ROS2 client library written in Rust. I have implemented it inde

rclrust 42 Dec 1, 2022
Yet another multi-purpose discord bot

virus yet another multi-purpose discord bot

miten 2 Jan 11, 2022
🥳Yet another crate to create native nodejs addons :)

nodex Yet another crate to create native nodejs addons :) This crate aims to make creating native nodejs addons very easy and comfortable. It is in a

uuhan 4 Mar 29, 2022