gs-translate-speak-fe
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

INSTALL

npm i gs-translate-speak-fe

EXAMPLE

Example for Simple

//const { Simple } = require("gs-translate-speak");  // cjs
import { Simple } from "gs-translate-speak"

(async () => {
  let T = new Simple()

  let detect = await T.detect({
    to: "vi",
    input: "Hello Viet Nam",
  })
  console.log(detect) // { language: 'en', confidence: 0.32941613, spell: {}

  let output = await T.translate({
    to: "vi",
    input: "Hello Viet Nam",
  })
  console.log(output) //Xin chào Việt Nam

  let voice = await T.speak({ input: "anh hợp vạn tuế", to: "vi" }) //return base 64
  fs.writeFileSync("./hehe2.mp3", voice, { encoding: 'base64', }) //save the voice

})()

Options

{
  from?: string,
  to?: string,
  host?: string,
  input?: string,
}

Package Sidebar

Install

npm i gs-translate-speak-fe

Weekly Downloads

3

Version

1.0.5

License

ISC

Unpacked Size

30 kB

Total Files

10

Last publish

Collaborators

  • hoptv