Giter Site home page Giter Site logo

aisay's Introduction

aisay

aisay means AI Say

Description

This tool generates speech from text using OpenAI's speech API and plays it back.

Installation

git clone https://github.com/vaderyang/aisay

To install the required dependencies, run:

cd aisay
pip install -r requirements.txt

Usage

Run the script with the following command: Setup your openai key

export OPENAI_API_KEY=sk-***********  

You may alternatively modify aisay.py direclty to put your openai key in client = OpenAI(api_key="sk-****") in a safe machine environment.

python3 aisay.py [arguments]

Arguments:

  • string: Text to say
  • -v/--voice: Voice model to use (default: onyx)
  • -f/--file: Text file to read input from
  • -o/--output: Output file path for the generated speech
  • -r/--rate: Playback speed of the generated speech (0.25 to 4.0)

Example

python3 aisay.py Hello World

Check the volume settings to make sure you hear the speech.

python3 aisay.py -v echo -o helloworld.mp3 Hello Again!

Extra Installation Options

If you want to make it as a system command for easier access, run:

sudo cp aisay.py /usr/local/bin/aisay
sudo chmod +x /usr/local/bin/aisay
aisay Hello World

if this doesn't work, find out the right path to save your aisay file by

echo $PATH

NOTICE

You may need proxy to connect to the OpenAI API server through export https_proxy environment variable.

License

BSD 2-Clause

aisay's People

Contributors

vaderyang avatar

Stargazers

 avatar

Watchers

 avatar  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.