2.7.0 • Published 8 months ago

speechstate v2.7.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
8 months 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.7.0

8 months ago

2.5.0

10 months ago

2.6.0

9 months ago

2.4.1-pr9-1.0

10 months ago

2.3.0

1 year ago

2.2.0

1 year ago

2.4.0

11 months ago

2.1.0

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

2.0.0-beta.11

1 year ago

2.0.0-beta.10

1 year ago

2.0.0-beta.9

1 year ago

2.0.0-beta.8

1 year ago

2.0.0-beta.7

1 year ago

2.0.0-beta.6

1 year ago

2.0.0-beta.5

1 year ago

2.0.0-beta.4

1 year ago

2.0.0-beta.3

1 year ago

2.0.0-beta.2

1 year ago

2.0.0-beta.1

1 year ago

2.0.0-beta.0

1 year ago

1.0.0

2 years ago