Skip to content

roj1512/gtr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gtr

Google Translate for Deno

import { GTR } from "https://deno.land/x/gtr/mod.ts";

const gtr = new GTR();

// Translate text.
const { trans } = await gtr.translate(
  "Your text",
  { targetLang: "es" },
);

// Create speech from text and save to file.
const result = await gtr.tts("Je parle en français.");

const data = new Uint8Array(
  await result.arrayBuffer(),
);

await Deno.writeFile("result.mp3", data);

About

Google Translate for Deno

Resources

License

Stars

Watchers

Forks

Packages

No packages published