npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tor-speech

v1.0.13

Published

Text speech api Yandex & Google + Tor

Downloads

58

Readme

logo

README is available in the following languages: Russian | English

Tor Speech

tor-speech - Speech synthesizer from text.

Why ?

When I had the task to convert text from chat to voice, I wondered how to do it, but I did not find anything other than paid services or very resource-intensive scripts, during the experiments I managed to get access to the paid API of search services yandex and google free of charge. I hope my contribution will make it easier for someone life.

Get started

Install the npm module tor-speech

$ npm install tor-speech

or

$ yarn add tor-speech

Examples and description

Connecting the module

const TorSpeech = require('tor-speech')

TorSpeech

The function TorSpeech initializes the connection to the Tor network takes the path to the tor binary file as a single parameter and returns an object with the keys: killTor, yandex, google, langCodes, saveFile. Don't forget to kill the Tor process if you don't use the module with killTor.

const TorSpeech = require('tor-speech')

;(async () => {
  const { killTor } = await TorSpeech()

  killTor()
})()

google

The function google is identical to the function yandex accepts an object whose keys include text and langCodes returns null or an audio file in base64.

object

| key | value | default value | required | information| | ------ | ------ | ------ | ------ | ------ | | text | text | test tor-speech module | no | script | | langCode | object | langCodes. russian | no | script language |

const TorSpeech = require('tor-speech')

;(async () => {
  const { killTor, google, langCodes } = await TorSpeech()

  const result = await google({
    text: 'Hi, how are you?',
    langCode: langCodes.english
  })

  console.log(result)

  killTor()
})()

yandex

The function yandex is identical to the function google accepts an object whose keys include text and langCodes returns null or an audio file in base64.

object

| key | value | default value | required | information| | ------ | ------ | ------ | ------ | ------ | | text | text | test tor-speech module | no | script | | langCode | object | langCodes.russian | no | script language

const TorSpeech = require('tor-speech')

;(async () => {
  const { killTor, yandex, langCodes } = await TorSpeech()

  const result = await yandex({
    text: 'Hi, how are you?',
    langCode: langCodes.english
  })

  console.log(result)

  killTor()
})()

langCodes

ObjectlangCode this is a set of language codes for yandex and google synthesizers.

object

| key | yandex | google | | ------ | ------ | ------ | | russian | ru_RU | ru | | english | en_EN | en |

const langCodes = {
  russian: { yandex: 'ru_RU', google: 'ru' },
  english: { yandex: 'en_EN', google: 'en' }
}

saveFile

The saveFile function saves base64 as an audio file.

| parameters | default value | required | information| | ------ | ------ | ------ | ------ | | string | null | yes | base64 string | | string | null | yes | path to save the audio file |

const TorSpeech = require('tor-speech')

;(async () => {
  const { killTor, google, langCodes, saveFile } = await TorSpeech()

  const base64 = await google({
    text: 'Hi, how are you?',
    langCode: langCodes.english
  })

  const isSave = await saveFile(base64, __dirname + '/google_hi_how_fuck_you.mp3')

  console.log(isSave)

  killTor()
})()

Contacts

My Telegram: @prohetamine, channel

Email: [email protected]

Donat money: patreon

If you have any questions and/or suggestions, please email me in telegram, if you find any bugs also let me know, I will be very grateful.