Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@speechly/browser-client

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@speechly/browser-client

Browser client for Speechly API

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
917
decreased by-9.83%
Maintainers
1
Weekly downloads
 
Created
Source

Speechly

speechly-browser-client

Release build npm version

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'

// Create a new Client. appId and language are configured in the dashboard.
const client = new Client({
  appId: 'your-app-id',
  language: 'en-US'
})

// Initialize the client - this will ask the user for microphone permissions and establish the connection to Speechly API.
// Make sure you call `initlialize` from a user action handler (e.g. from a button press handler).
client.initialize((err?: Error) => {
  if (err !== undefined) {
    console.error('Failed to initialize Speechly client:', err)
  }
})

// React to the phrases received from the API
client.onSegmentChange((segment: Segment) => {
  console.log('Received new segment from the API:', segment.intent, segment.entities, segment.words, segment.isFinal)
})

// Start recording
client.startContext((err?: Error) => {
  if (err !== undefined) {
    console.error('Failed to start recording:', err)
    return
  }

  // Stop recording after 3 seconds
  setTimeout(client.stopContext, 3000)
})

Check out the demo in examples directory.

Documentation

You can find the detailed API documentation in GitHub repository.

Keywords

FAQs

Package last updated on 02 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc