JSPM

baragouin

0.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q36457F
  • License ISC

Good old gibberish for your virtual characters

Package Exports

  • baragouin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (baragouin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Baragouin

Good old gibberish for your virtual characters


Baragouin is a JavaScript library that will give a (unintelligible) voice to your virtual characters.

Demo, examples and documentation

Check out the website: https://sylvainpolletvillard.github.io/baragouin/

Installation

Available as ES module on npm:

> npm install baragouin
import baragouin from "baragouin"

or as minified bundle on CDN:

<script src="https://umd.cdn.pika.dev/baragouin/">
<script>baragouin("now available as global")<script>

Usage

baragouin(text, options)

let speech = baragouin("Hello World !", {
  voice: "sine",
  volume: 50,
  speed: 30,
  emotion: 40,
  pitch: 25,
  resonance: 10,

  onNote(text, time){
    // this is called at every syllab pronounced,
    // with the text read so far. Perfect time
    // to update the text of a message balloon
  },
  onEnd(text, time){
    // this is called once at the end of the speech
  }
})

setTimeout(() => {
    // stop talking after 5 seconds
    speech.stop()
}, 5000)

Note that to be allowed to make sounds, user must interact with the page first (click on something)