bellows-voice 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,28 @@ alto.speak('Good morning. Where are you from?', { accent: 'australian' });
|
|
|
25
25
|
|
|
26
26
|
`voice` is a bellows plugin: the engine, prebuilt as one script that loads into bellows' AudioWorklet beside its kernel, so a page that never sings never loads it. `singer(b, params, opts)` makes an instrument on it and gives it `sing()` and `speak()`, which reach bellows only through its public API. Notes go through bellows' tempo map and tuning like any other note.
|
|
27
27
|
|
|
28
|
+
## In a single HTML file, from a CDN
|
|
29
|
+
|
|
30
|
+
bellows-voice imports `bellowsjs` by name, so a page without a bundler maps that name with an import map. The map is also what makes the page and the voice share one copy of bellows; with two copies, `singer()` cannot see the plugin and throws.
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<script type="importmap">
|
|
34
|
+
{ "imports": { "bellowsjs": "https://cdn.jsdelivr.net/npm/bellowsjs@0.5/dist/bellows.js" } }
|
|
35
|
+
</script>
|
|
36
|
+
<script type="module">
|
|
37
|
+
import { Bellows } from 'bellowsjs';
|
|
38
|
+
import { voice, singer } from 'https://cdn.jsdelivr.net/npm/bellows-voice@0.2/dist/index.js';
|
|
39
|
+
|
|
40
|
+
document.querySelector('button').onclick = async () => {
|
|
41
|
+
const b = await Bellows.boot({ plugins: [voice] });
|
|
42
|
+
singer(b, { body: 1 }).speak('Hello from a single file.');
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
45
|
+
<button>Speak</button>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The other entries load the same way: `.../dist/text.js`, `.../dist/view.js`, `.../dist/engine.js`. unpkg serves the same files (`https://unpkg.com/bellows-voice@0.2/dist/index.js`).
|
|
49
|
+
|
|
28
50
|
## Accents
|
|
29
51
|
|
|
30
52
|
```js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bellows-voice",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "An articulatory singing and speaking voice for bellowsjs: a physical model of a singer, lyrics and text in eight English accents, and text to IPA.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|