Socket
Book a DemoInstallSign in
Socket

sanskrit-tts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanskrit-tts

Generate text-to-speech for Sanskrit.

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
6
20%
Maintainers
1
Weekly downloads
 
Created
Source

Sanskrit Text-to-Speech 🕉️

Generate text-to-speech for Sanskrit.

संस्कृत वाङ्निर्मिति

Installation ⬇️

$ npm install sanskrit-tts

Usage

Import the sanskrit-tts module:

import tts from "sanskrit-tts"
const tts = require("sanskrit-tts") // CommonJS

Methods

💾 Save to disk:

tts.saveFile("aham vanam gacchāmi", { 
    script: "iast", 
    fileName: "audio.mp3" 
});

You can make it slower if you need:

tts.saveFile("अहं वक्तुं शक्नोमि", { 
    script: "devanagari", 
    slow: true, 
    fileName: "audio.mp3" 
});

🔗 Get URL:

let url = tts.getURL("कथम् अस्ति भवान्", { script: "devanagari" })
console.log(url);

// Returns: https://translate.google.com/translate_tts...

🔢 Get Audio in Base64 encoding:

let base64 = tts.getBase64("ओम् नमः शिवाय", { script: "devanagari" })
console.log(base64);

🔗 Get All URLs (For queries more than 200 characters): 🔗

let urls = tts.getAllURLs("गणितम् पठामः", { script: "devanagari" })
console.log(urls);

// Returns [Array]

You can also do the same to get Base64 encodings for queries more than 200 characters using tts.getAllBase64().

🆎 Supported Scripts

Sanskrit TTS uses the SanscriptJS module to transliterate your Sanskrit input. The following scripts are supported:

  • bengali
  • devanagari
  • gujarati
  • gurmukhi
  • kannada
  • malayalam
  • oriya
  • tamil
  • telugu
  • grantha
  • grantamil
  • hk (Harvard-Kyoto)
  • iast (International Alphabet of Sanskrit Transliteration)
  • iso15919 (ISO 15919)
  • itrans (ITRANS)
  • slp1 (Sanskrit Library Phonetic Basic)
  • velthuis (Velthuis)
  • wx (WX)

⚖️ License

MIT

Keywords

sanskrit

FAQs

Package last updated on 21 Feb 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.