Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.

Files

Latest commit

bde64a0 · Feb 3, 2022

History

History

with-next

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 25, 2021
Jun 25, 2021
Oct 27, 2021
Nov 6, 2020
Nov 30, 2021
Mar 25, 2021
Jun 25, 2021
Aug 24, 2021
Aug 20, 2021
Oct 19, 2021
Apr 21, 2020
Aug 24, 2021
Jun 25, 2021
Apr 21, 2020
Mar 5, 2021
Feb 3, 2022
Feb 3, 2022
Jul 22, 2020
Oct 27, 2021
Nov 18, 2020
Jun 25, 2021

with-next

This example is built on Next.js.

It is a proof-of-concept using Spokestack to demonstrate searching a database with voice using ASR and reading off the first result with text-to-speech.

Usage

This example is deployed publicly at https://demo.spokestack.io.

$ git clone git@github.com:spokestack/node-spokestack.git
$ cd node-spokestack
$ npm install
$ cd examples/with-next
$ cp .env.local.example. .env.local # Fill in your credentials here. See "Getting Spokestack Credentials" below.
$ npm install
$ npm run dev

Then visit http://localhost:3000 in your browser.

Visit http://localhost:3000/graphql to view introspection docs on the Spokestack GraphQL API for synthesizing text to speech.

See server/index.ts for example code using Next.js and Express.

Getting Spokestack Credentials

Getting Spokestack credentials is easy and free. Go to spokestack.io and create an account. Create a token in the settings section, at spokestack.io/account/settings#api. Note that you'll only be able to see the token secret once. If you accidentally leave the page, create another token.

Once you have a token, copy .env.local.example to .env.local and add your credentials to that file.

Run example using Google ASR instead of Spokestack ASR

This command will run the server and use Google Cloud Speech instead of Spokestack ASR

$ ASR_SERVICE=google npm run dev

Then visit http://localhost:3000 in your browser.