Comments (4)
I was going to contribute to this repo but I decided to just do a rewrite since so much code would have to change:
https://github.com/ncpierson/google-translate-tts
Can use with:
yarn add google-translate-tts
then
const tts = require('google-translate-tts');
const buffer = await tts.synthesize({ text: 'Hello, world!', voice: 'en-US' });
fs.writeFileSync('hello-world.mp3', buffer);
It's not perfect, but it's all I needed for soundoftext.com, and I'll keep working on it.
from google-tts.
@ncpierson
If you are in a hurry please use the following package instead of this one
https://github.com/freddiefujiwara/google-tts/tree/feature/fix-dec-1
in your package.json
"dependencies": {
...
"google-tts-api": "https://github.com/freddiefujiwara/google-tts#feature/fix-dec-1",
...
},
from google-tts.
New Google TTS API has been implemented in version 2.0.0, and there are some breaking changes.
Please see more details in README and CHANGELOG
Thanks.
const fs = require('fs');
const googleTTS = require('google-tts-api');
// get base64 text
googleTTS
.getAudioBase64('Hello World', { lang: 'en-US', slow: false })
.then((base64) => {
console.log({ base64 });
// save the audio file
const buffer = Buffer.from(base64, 'base64');
fs.writeFileSync('hello-world-english.mp3', buffer, { encoding: 'base64' });
})
.catch(console.error);
from google-tts.
It looks like this change went 100% today. All requests are failing for me. Solving this will solve #33 though I don't know how difficult it will be.
from google-tts.
Related Issues (20)
- Translate long texts HOT 1
- 1 node-fetch vulnerability found in package-lock.json HOT 2
- get key failed from google HOT 9
- get token key failed from google HOT 9
- tts with join channel HOT 4
- Error: get token key failed from google HOT 1
- Change voice Gender HOT 1
- lang code en-US,en-AU not working with getAudioBase64, getAllAudioBase64 HOT 2
- Add support for "auto" language HOT 1
- .
- different speed options?
- Occasionally getting a different voice
- Causes for missing responses
- Not able to use in react-native project HOT 1
- Error: get key failed from google in version 0.0.6
- [Question] Stream Format of getAllAudioUrls
- Pricing
- Security concern
- Does this require any kind of key or billing? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-tts.