Stawa / GTTS

This project converts written material into speech by using Google AI (Gemini) for text creation or internet searches.

Home Page:https://stawa.github.io/GTTS/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gemini Icon Gemini Text-To-Speech Gemini Icon

Convert written material into speech using Google AI (Gemini) for text creation or internet searches.

Google Gemini Made with TypeScript Powered by Bun Documentation SonarCloud Reliability Rating


πŸ“œ Table of Contents

  1. How It Works
  2. Project Note
  3. Project Installation
  4. Project Examples
  5. Contributors

❓ How It Works

This project is based on an example in test/app.ts. It fetches a voice, sends a request to the Google Gemini API to receive an AI-generated response, and automatically plays it as TTS.


πŸ“Œ Project Note

This project is tested on Linux (Ubuntu 24.04 LTS x86_64). Windows users can install SoX via SourceForge. No MacOS-specific information is available.

Task Priority Complete Status
Implement Gemini Chat High βœ“ Completed
Develop Voice Recognition High βœ“ Completed
Implement Audio Language Detection High βœ“ Completed
Implement Text Language Detection Medium βœ“ Completed
Implement an Audio Player Low βœ“ Completed
Define Enums Low βœ“ Completed
Integrate Debugging Low βœ“ Completed

πŸ“¦ Project Installation

Before using this repository, ensure the following libraries are installed on Linux:

Then install the repository using the following commands:

# npm
$ npm install git+https://github.com/Stawa/GTTS.git --legacy-peer-deps
# Bun
$ bun install git+https://github.com/Stawa/GTTS.git --trust

πŸ“„ Project Examples

Requirements for successful execution:

  • Google Gemini API Key (lib.GoogleGemini)
  • TikTok SessionID (lib.TextToSpeech)
  • Google Speech API Key (lib.VoiceRecognition.fetchTranscriptGoogle)
  • Deepgram API Key (lib.VoiceRecognition.fetchTranscriptDeepgram)
  • EdenAI (lib.SummarizeText)

This is an example of how you get a generated response from the Google Gemini API; it only takes one function:

import { GoogleGemini } from "@stawa/gtts";

const google = new GoogleGemini({
  apiKey: "XXXXX",
  logger: true,
});

async function app() {
  const res = await google.chat("When was Facebook launched?");
  console.log(res);
}

app();

πŸ‘₯ Contributors

Contributors

About

This project converts written material into speech by using Google AI (Gemini) for text creation or internet searches.

https://stawa.github.io/GTTS/

License:MIT License


Languages

Language:TypeScript 84.6%Language:Python 15.4%