bol
v0.1.6
Published
Currently just a wrapper around speechSynthesis with slightly better consistency in voices, Trying to be super consistent! Text-to-speech for Web.
Downloads
15
Readme
Bol (बोल) 🗣
TTS Library for Web
Currently just a wrapper around speechSynthesis with slightly better consistency in voices, Trying to be super consistent! Text-to-speech for Web.
Meant to be used on frontend.
NOT READY FOR PROD
If you still want to ruin your life, here's how you can do it:
Installation
npm install --save bol
or
<script src="https://unpkg.com/bol@^0/dist/bol.min.js"></script>
Usage
ES Module
import Bol from 'bol';
const bol = new Bol("UK English Female", {rate: .8, pitch: 1, volume: 1})
bol.speak("Whhatta useless package", "UK English Male")
.then(elapsedTime => console.log(elapsedTime))
or
Vanilla Script Include
<body>
<button class="talk">Fact of the Day</button>
<script src="https://unpkg.com/bol@^0/dist/bol.min.js"></script>
<script>
const bol = new Bol('UK English Male', {rate: .8});
document.querySelector('.talk').addEventListener('click', e => {
bol.speak("HTML is a programming language!")
.then(elapsedTime => {
console.log(elapsedTime);
})
})
</script>
</body>
Make sure you wrap bol.speak around a user's touch, swipe, click handlers to make it work.
Voices
- "UK English Male"
- "UK English Female"
- "US English Male"
- "US English Female"
Me!
🌻