Giter Club home page Giter Club logo

fakeyou-api's Introduction

fakeyou-api

A very simple Rust library for FakeYou API.

API

Check the official API reference.

API Support
Text to Speech ✔️
Voices ✔️
Categories ✔️

Usage

Install the library using the Cargo.toml file or run the following command.

cargo add fakeyou-api

Export your API key into the environment variables (if you use the paid version).

export FAKEYOU_API_KEY=...

Then use the crate in your Rust code:

// Import the dependencies
use fakeyou_api::{tts::InferenceBody, util::tts::TtsApiSync, *};

// You can create a default client without any api key.
// You can also load the API key from environment FAKEYOU_API_KEY.
// You can also hadcode through `Auth::new(<your_api_key>)`, but it is not recommended.
let auth = Auth::default();
let fakeyou = FakeYou::new(auth, FAKEYOU_API_URL);

// Create the TTS body
let inference_body =
    InferenceBody::new("TM:ebgxj0j4fvzp", "Hello, World! What should we do today?");

// Call the TTS API
// This uses the util module of this crate and will block the thread until the task is done
let output_result = fakeyou.create_tts_task(&inference_body).unwrap();

// Do what you need with the audio file
std::fs::write("output.wav", output_result.bytes).unwrap();

License

This project is licensed under MIT

fakeyou-api's People

Contributors

alexjercan avatar

Stargazers

 avatar

Watchers

 avatar

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.