speechly-browser-client
This repository contains source code for the browser client for Speechly SLU API. Speechly allows you to easily build applications with voice-enabled UIs.
Usage
Install the package:
# Using Yarn
yarn add @speechly/browser-client
# Using NPM
npm install --save @speechly/browser-client
Start using the client:
import { Client, Segment } from '@speechly/browser-client'
const client = new Client({
appId: 'your-app-id',
language: 'en-US'
})
client.initialize((err?: Error) => {
if (err !== undefined) {
console.error('Failed to initialize Speechly client:', err)
}
})
client.onSegmentChange((segment: Segment) => {
console.log('Received new segment from the API:', segment.intent, segment.entities, segment.words, segment.isFinal)
})
client.startContext((err?: Error) => {
if (err !== undefined) {
console.error('Failed to start recording:', err)
return
}
setTimeout(client.stopContext, 3000)
})
Check out the demo in examples directory.
Documentation
You can find the detailed API documentation in GitHub repository.