![Speechly](https://www.speechly.com/images/logo.png)
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, ISegment } 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: ISegment) => {
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)
})
Documentation
Check the detailed API documentation in the docs directory.
Contributing
If you found a bug, please submit an issue with steps to reproduce it. If you would like to contribute to the codebase, feel free to submit the PR and request one of the maintainers to review it.