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.
This example is deployed publicly at https://demo.spokestack.io.
$ git clone [email protected]: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 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.
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.