Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-tts-mp3

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-tts-mp3 - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"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 => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc