@npcify/web 0.3.0 → 0.4.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/examples/main.js CHANGED
@@ -35,19 +35,22 @@ character.onOptionsReady(({ options }) => {
35
35
  }
36
36
  talk.disabled = false
37
37
  })
38
- // Hold the button, or Space, to talk. The release sends the speech.
38
+ // Hold the button, or Space, to talk. The release sends the speech. Voice
39
+ // needs the character's voice input (its owner turns it on in the STT tab).
39
40
  talk.hidden = !character.inputModes.includes('voice')
40
- character.bindPushToTalk({
41
- element: talk,
42
- enabled: () => !talk.disabled,
43
- onResult: ({ sent }) => {
44
- if (sent) {
45
- replies.replaceChildren()
46
- talk.disabled = true
47
- }
48
- },
49
- onError: report,
50
- })
41
+ if (!talk.hidden) {
42
+ character.bindPushToTalk({
43
+ element: talk,
44
+ enabled: () => !talk.disabled,
45
+ onResult: ({ sent }) => {
46
+ if (sent) {
47
+ replies.replaceChildren()
48
+ talk.disabled = true
49
+ }
50
+ },
51
+ onError: report,
52
+ })
53
+ }
51
54
  character.onListeningState((state) => {
52
55
  talk.textContent =
53
56
  { listening: 'Listening…', recognizing: 'Recognizing…' }[state] ?? 'Hold to talk'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npcify/web",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Framework-independent Npcify characters, live conversations and baked performances for the web",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",