{"id":21010632,"url":"https://github.com/prohetamine/tor-speech","last_synced_at":"2025-05-15T03:31:53.020Z","repository":{"id":44868732,"uuid":"375209817","full_name":"prohetamine/tor-speech","owner":"prohetamine","description":"🔉 Yandex \u0026 Google + Tor","archived":false,"fork":false,"pushed_at":"2022-02-08T11:09:11.000Z","size":71,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T20:37:36.583Z","etag":null,"topics":["free","npm","npm-package","speech-recognition","speech-synthesis","speech-to-text","tor","tor-network","tts"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prohetamine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-09T03:05:32.000Z","updated_at":"2022-09-18T08:44:56.000Z","dependencies_parsed_at":"2022-09-17T15:43:00.390Z","dependency_job_id":null,"html_url":"https://github.com/prohetamine/tor-speech","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prohetamine%2Ftor-speech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prohetamine%2Ftor-speech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prohetamine%2Ftor-speech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prohetamine%2Ftor-speech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prohetamine","download_url":"https://codeload.github.com/prohetamine/tor-speech/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254266269,"owners_count":22042079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["free","npm","npm-package","speech-recognition","speech-synthesis","speech-to-text","tor","tor-network","tts"],"created_at":"2024-11-19T09:21:50.028Z","updated_at":"2025-05-15T03:31:52.665Z","avatar_url":"https://github.com/prohetamine.png","language":"JavaScript","funding_links":["https://www.patreon.com/prohetamine"],"categories":[],"sub_categories":[],"readme":"![logo](https://github.com/prohetamine/tor-speech/blob/main/media/logo.png)\n\n##### README is available in the following languages: [Russian](https://github.com/prohetamine/tor-speech/blob/main/README/russian.md) | [English](https://github.com/prohetamine/tor-speech/blob/main/README.md)\n\n\n# Tor Speech\n\n\u003e tor-speech - Speech synthesizer from text.\n\n### Why ?\nWhen 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](https://yandex.ru) and [google](https://google.com) free of charge. I hope my contribution will make it easier for someone [life](https://www.patreon.com/prohetamine).\n\n### Get started\n\nInstall the npm module  ```tor-speech```\n\n```sh\n$ npm install tor-speech\n```\n\nor\n\n```sh\n$ yarn add tor-speech\n```\n\n### Examples and description\n\nConnecting the module\n\n```javascript\nconst TorSpeech = require('tor-speech')\n```\n\n#### \u003ca name=\"torspeech\"\u003eTorSpeech\u003c/a\u003e\n\nThe function [TorSpeech](#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](#yandex), [google](#google), [langCodes](#langcodes), [saveFile](#savefile). Don't forget to kill the Tor process if you don't use the module with killTor.\n\n```javascript\nconst TorSpeech = require('tor-speech')\n\n;(async () =\u003e {\n  const { killTor } = await TorSpeech()\n\n  killTor()\n})()\n```\n\n#### \u003ca name=\"google\"\u003egoogle\u003c/a\u003e\n\nThe function [google](#google) is identical to the function [yandex](#yandex) accepts an object whose keys include text and [langCodes](#langcodes) returns null or an audio file in base64.\n\n##### object\n\n| key | value | default value | required | information|\n| ------ | ------ | ------ | ------ | ------ |\n| text | text | test tor-speech module | no | script |\n| langCode | object | langCodes. russian | no | script language |\n\n```javascript\nconst TorSpeech = require('tor-speech')\n\n;(async () =\u003e {\n  const { killTor, google, langCodes } = await TorSpeech()\n\n  const result = await google({\n    text: 'Hi, how are you?',\n    langCode: langCodes.english\n  })\n\n  console.log(result)\n\n  killTor()\n})()\n```\n\n#### \u003ca name=\"yandex\"\u003eyandex\u003c/a\u003e\n\nThe function [yandex](#yandex) is identical to the function [google](#google) accepts an object whose keys include text and [langCodes](#langcodes) returns null or an audio file in base64.\n\n##### object\n\n| key | value | default value | required | information|\n| ------ | ------ | ------ | ------ | ------ |\n| text | text | test tor-speech module | no | script |\n| langCode | object | langCodes.russian | no | script language\n\n```javascript\nconst TorSpeech = require('tor-speech')\n\n;(async () =\u003e {\n  const { killTor, yandex, langCodes } = await TorSpeech()\n\n  const result = await yandex({\n    text: 'Hi, how are you?',\n    langCode: langCodes.english\n  })\n\n  console.log(result)\n\n  killTor()\n})()\n```\n\n#### \u003ca name=\"langcodes\"\u003elangCodes\u003c/a\u003e\n\nObject[langCode](#langcodes) this is a set of language codes for [yandex](#yandex) and [google](#google) synthesizers.\n\n##### object\n\n| key | yandex | google |\n| ------ | ------ | ------ |\n| russian | ru_RU | ru |\n| english | en_EN | en |\n\n```javascript\nconst langCodes = {\n  russian: { yandex: 'ru_RU', google: 'ru' },\n  english: { yandex: 'en_EN', google: 'en' }\n}\n```\n\n#### \u003ca name=\"savefile\"\u003esaveFile\u003c/a\u003e\n\nThe [saveFile](#savefile) function saves base64 as an audio file.\n\n| parameters | default value | required | information|\n| ------ | ------ | ------ | ------ |\n| string | null | yes | base64 string |\n| string | null | yes | path to save the audio file |\n\n```javascript\nconst TorSpeech = require('tor-speech')\n\n;(async () =\u003e {\n  const { killTor, google, langCodes, saveFile } = await TorSpeech()\n\n  const base64 = await google({\n    text: 'Hi, how are you?',\n    langCode: langCodes.english\n  })\n\n  const isSave = await saveFile(base64, __dirname + '/google_hi_how_fuck_you.mp3')\n\n  console.log(isSave)\n\n  killTor()\n})()\n```\n\n### Contacts\n\nMy Telegram: [@prohetamine](https://t.me/prohetamine), [channel](https://t.me/prohetamines)\n\nEmail: prohetamine@gmail.com\n\nDonat money: [patreon](https://www.patreon.com/prohetamine)\n\nIf 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprohetamine%2Ftor-speech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprohetamine%2Ftor-speech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprohetamine%2Ftor-speech/lists"}