New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jackdbd/eleventy-plugin-text-to-speech

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jackdbd/eleventy-plugin-text-to-speech

Eleventy plugin for the Google Cloud Text-to-Speech API

  • 1.0.0-alpha.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-80.56%
Maintainers
1
Weekly downloads
 
Created
Source

@jackdbd/eleventy-plugin-text-to-speech

npm version Snyk Vulnerabilities for npm package

Eleventy plugin that send messages to a Telegram chat of your choice.

Installation

npm install --save-dev @jackdbd/eleventy-plugin-text-to-speech

Before you can begin using the Text-to-Speech API, you must enable it. Using Cloud Shell, you can enable the API with the following command:

gcloud services enable texttospeech.googleapis.com

Create a service account that can use the Text-to-Speech API.

gcloud iam service-accounts create sa-text-to-speech-user \
  --display-name "Text-to-Speech user SA"

Usage

const { textToSpeechPlugin } = require('@jackdbd/eleventy-plugin-text-to-speech')

module.exports = function (eleventyConfig) {
  // some eleventy configuration...

  eleventyConfig.addPlugin(textToSpeechPlugin, {
    audioEncoding: 'OGG_OPUS',
    keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS,
    regexPattern: '.*/posts/.*.html$',
    voice: { languageCode: 'en-GB', name: 'en-GB-Wavenet-C' }
  })

  // some more eleventy configuration...
}

Configuration

Options

OptionDefaultExplanation
audioEncodingOGG_OPUSEncoding for the audio file. It must be one of supported audio encodings of the Cloud Text-to-Speech API.
regexPattern.*.html$regex pattern to find text files to convert into speech.
keyFilenameprocess.env.GOOGLE_APPLICATION_CREDENTIALScredentials for the Cloud Text-to-Speech API.
voiceLanguageCodeen-USName of the Text-to-Speech languageCode to use. See list here.
voiceNameen-US-Standard-JName of the Text-to-Speech voice to use. See list here.

:warning: Don't forget to set either keyFilename or the GOOGLE_APPLICATION_CREDENTIALS environment variable on your build server. For example, if your build runs on the Github CI, use GitHub secrets; if the build runs on Netlify, use Build environment variables.

Keywords

FAQs

Package last updated on 05 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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