1.0.5 • Published 1 year ago

gs-translate-speak-fe v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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,
}
1.0.5

1 year ago

1.0.4

1 year ago