speechstate v2.7.0
#+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
- Apply for free student credits https://azure.microsoft.com/en-us/free/students/. You should be able to login with your GU account.
- Make sure that you are logged into the Azure portal (https://portal.azure.com/).
- Create a Resource group (you can use search field):
- Subscription: Azure for students
- Resource group: any name
- Region: (Europe) North Europe
- 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
- Within your Speech Service go to: Resourse management → Keys and Endpoint and copy your KEY 1.
10 months ago
10 months ago
11 months ago
11 months ago
12 months ago
11 months ago
10 months ago
12 months ago
12 months ago
12 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago