2.0.5 • Published 13 days ago

speechstate v2.0.5

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
13 days ago

#+TITLE: SpeechState

  • SDK

** Spawn SpeechState #+begin_src typescript import { speechstate } from "speechstate";

// start with this action in your state chart assign({ spstRef: ({ spawn }) => { return spawn(speechstate, { input: { settings: ... }, }); }, }), #+end_src

#+begin_src typescript interface AzureCredentials { endpoint: string; key: string; }

interface Settings { locale: string; azureCredentials: string | AzureCredentials; // you can use proxy URL or full credentials asrDefaultCompleteTimeout: number; } #+end_src

** Events Example action: #+begin_src typescript ({ context }) => context.spstRef.send({ type: "SPEAK", value: { utterance: "Hello world", voice: "en-GB-RyanNeural" }, }); #+end_src

*** DM to SpeechState

  • ~{ type: "PREPARE" }~
  • ~{ type: "SPEAK"; value: Agenda }~
  • ~{ type: "LISTEN" }~
  • ~{ type: "CONTROL" }~
  • ~{ type: "STOP" }~

*** SpeechState to DM

  • ~{ type: "ASRTTS_READY" }~
  • ~{ type: "ASR_NOINPUT" }~
  • ~{ type: "RECOGNISED"; value: Hypothesis[] }~
  • ~{ type: "SPEAK_COMPLETE" }~
  • ~{ type: "ASR_STARTED" }~
  • ~{ type: "TTS_STARTED" }~ ** Types: #+begin_src typescript interface Hypothesis { utterance: string; confidence: number; }

interface Agenda { utterance: string; voice?: string; // defaults to "en-US-DavisNeural" streamURL?: string; } #+end_src

  • How to run ~SpeechState~ ** Create Azure account and enable speech services
  1. Apply for free student credits https://azure.microsoft.com/en-us/free/students/. You should be able to login with your GU account.
  2. Make sure that you are logged into the Azure portal (https://portal.azure.com/).
  3. Create a Resource group (you can use search field):
    • Subscription: Azure for students
    • Resource group: any name
    • Region: (Europe) North Europe
  4. Create a Speech service:
    • Name: any name
    • Subscription: Azure for students
    • Location: (Europe) North Europe
    • Pricing tier: Free (F0)
    • Resource group: group name from the previous step
  5. Within your Speech Service go to: Resourse management → Keys and Endpoint and copy your KEY 1.
2.0.5

13 days ago

2.0.4

16 days ago

2.0.3

26 days ago

2.0.2

27 days ago

2.0.1

27 days ago

2.0.0

1 month ago

2.0.0-beta.11

2 months ago

2.0.0-beta.10

2 months ago

2.0.0-beta.9

2 months ago

2.0.0-beta.8

2 months ago

2.0.0-beta.7

3 months ago

2.0.0-beta.6

3 months ago

2.0.0-beta.5

3 months ago

2.0.0-beta.4

3 months ago

2.0.0-beta.3

3 months ago

2.0.0-beta.2

4 months ago

2.0.0-beta.1

4 months ago

2.0.0-beta.0

4 months ago

1.0.0

7 months ago