gs-translate-speak-fe
v1.0.5
Published
gs translate speak
Downloads
3
Maintainers
Readme
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,
}