Skip to main content

A simple deno text-to-speech library using the google translate api.

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
94%
Published
6 months ago (1.0.2)

deno-gtts

Note


This is a fork of https://github.com/dunosaurs/gtts with new default method

A simple text-to-speech library using the google translate api. It is designed to be used either as a deno library or as a cli tool.

Usage

import gtts, { save } from "https://deno.land/x/gtts/mod.ts";
await gtts("Hello world");
await save("./demo.wav", "This sentence is being read by a machine");

OR

deno install --allow-write --allow-net -n gtts https://deno.land/x/gtts/cli.ts
gtts "some text to speak"
gtts "some text to speak to a destination" --path="./test.wav"
gtts "text but in a french accent" --lang=fr
gtts "text at a destination but in a french accent" --path="./french.wav" --lang=fr

Very loosely inspired by this nightmare of a library

Add Package

deno add jsr:@ilawy/gtts

Import symbol

import * as gtts from "@ilawy/gtts";

---- OR ----

Import directly with a jsr specifier

import * as gtts from "jsr:@ilawy/gtts";

Add Package

npx jsr add @ilawy/gtts

Import symbol

import * as gtts from "@ilawy/gtts";

Add Package

yarn dlx jsr add @ilawy/gtts

Import symbol

import * as gtts from "@ilawy/gtts";

Add Package

pnpm dlx jsr add @ilawy/gtts

Import symbol

import * as gtts from "@ilawy/gtts";

Add Package

bunx jsr add @ilawy/gtts

Import symbol

import * as gtts from "@ilawy/gtts";