simple-tts-mp3
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "simple-tts-mp3", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Converts text to mp3 audio using google-tts-api, it hasn't a limit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# simple-tts-mp3 package | ||
This package provides two methods to create MP3 audio files from text using the google-tts-api module, find it on [npm](https://www.npmjs.com/package/simple-tts-mp3/)! | ||
If you like it, please leave a ⭐ **STAR** on [GitHub](https://github.com/eliangerard/simple-tts-mp3) ⭐ | ||
| Method | Options [optional] | Description | | ||
| ------------------- | ---------------------------------------- | --------------------------------------------------- | | ||
| createAudioFile | text, fileName, [language = 'en'] | Creates an mp3 audio file from text. | | ||
| getAudioBuffer | text, [language = 'en'] | Promise (Buffer) | | ||
| getAudioBuffer | text, [language = 'en'] | Creates an mp3 audio buffer from text and returns it - Promise (Buffer) | | ||
@@ -19,11 +21,22 @@ * text - The text to convert to audio. | ||
### Usage | ||
+ createAudioFile( text, fileName, language = 'en') | ||
```js | ||
// Importing create file method from package | ||
const { createAudioFile } = require('simple-tts-mp3'); | ||
// Creates an "output.mp3" audio file with default English text | ||
createAudioFile('Hi, How are you?', 'output'); | ||
// Creates an "output.mp3" audio file with Spanish text | ||
createAudioFile('Hola, ¿Cómo estás?', 'output', 'es'); | ||
// Creates an "output.mp3" audio file with Spanish text inside the "audios" folder | ||
createAudioFile('Todo bien, gracias', './audios/output', 'es'); | ||
``` | ||
+ getAudioBuffer( text, language = 'en') | ||
```js | ||
// Importing the package and methods | ||
const { createAudioFile, getAudioBuffer } = require('simple-tts-mp3'); | ||
// Importing create | ||
const { getAudioBuffer } = require('simple-tts-mp3'); | ||
// Create an MP3 audio file with Spanish text | ||
createAudioFile('Hola, ¿cómo estás?', 'hello', 'es'); | ||
// Get an MP3 audio buffer with Spanish text | ||
// Creates an MP3 audio buffer with Spanish text and resolves the promise with it | ||
getAudioBuffer('Hola, ¿cómo estás?', 'es') | ||
@@ -30,0 +43,0 @@ .then(buffer => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5183
46