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

@speechly/react-ui

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@speechly/react-ui

Speechly UI Components

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52
increased by6.12%
Maintainers
2
Weekly downloads
 
Created
Source

Speechly

Complete your touch user interface with voice

Speechly website   |   Docs   |   Blog

Speechly React UI components

Release build npm version License

Installation

# Create a new React app
create-react-app .

# Install the package
npm install --save @speechly/react-ui

# Install peer dependencies
npm install --save @speechly/react-client
npm install --save react-spring
npm install --save styled-components @types/styled-components

Usage

Push-to-Talk Button Component

Push-to-Talk Button is a React component that enables users to use Speechly voice input while holding the button down.

The Push-to-Talk button is intended to be placed as a floating button at the lower part of the screen so mobile users can react it with ease. Desktop users can control it with an optional keyboard hotkey. Our hotkey recommendation is the spacebar.

Upon launching the app, the component initially displays a "power on" state. Pressing the button in "power on" state initialises Speechly API and may trigger browser microphone permission prompt.

The component has been tested with Chrome on desktop (version 86), Chrome on Android (version 86) and Safari (12) on iOS.

Including PushToTalkButton into your app

import { SpeechProvider } from "@speechly/react-client";
import { PushToTalkButton, PushToTalkContainer } from "@speechly/react-ui";

function AppView() {
  return (
    <SpeechProvider appId="speechly-app-id" language="speechly-app-language">
      <PushToTalkContainer>
        <PushToTalkButton captureKey=" " />
      </PushToTalkContainer>
    </SpeechProvider>
  );
}

Customizing PushToTalkButton

  • Mic widget size is defined by size property. Parameters are in css, e.g. 6rem.
  • Colors are defined by gradientStops property. Parameter is an array of 2 colors, e.g. ["#","#"].
  • If you created the app skeleton using the react-client tutorial, you may wish to remove the following lines containing the default button for toggling speech recording:
<div className="mic-button">
  <button onClick={toggleRecording}>Record</button>
</div>

BigTranscript Component

BigTranscript is a React component that displays the transcribed voice input of a user to provide them with feedback from your Speechly app.

Including BigTranscript into your app

import { SpeechProvider } from "@speechly/react-client";
import { BigTranscript, BigTranscriptContainer } from "@speechly/react-ui";

function AppView() {
  return (
    <SpeechProvider appId="speechly-app-id" language="speechly-app-language">
      <BigTranscriptContainer>
        <BigTranscript />
      </BigTranscriptContainer>
    </SpeechProvider>
  );
}

Customizing BigTranscript

Styling like colors can be assigned to .BigTranscript container class and to different entity types by using .Entity.<EntityName> selector. Replace <EntityName> with the exact entity name defined in your SAL.

.BigTranscript {
  color: #fff;
  font-family: "Organetto";
  font-size: 1.4rem;
  line-height: 1.15;
}

.BigTranscript .Entity.room {
  color: #1fd3f3;
}

.BigTranscript .Entity.device {
  color: #1fd3f3;
}

Documentation

You can find the detailed API documentation in GitHub repository.

About Speechly

Speechly is a developer tool for building real-time multimodal voice user interfaces. It enables developers and designers to enhance their current touch user interface with voice functionalities for better user experience. Speechly key features:

Speechly key features
  • Fully streaming API
  • Multi modal from the ground up
  • Easy to configure for any use case
  • Fast to integrate to any touch screen application
  • Supports natural corrections such as "Show me red – i mean blue t-shirts"
  • Real time visual feedback encourages users to go on with their voice
Example applicationDescription
Instead of using buttons, input fields and dropdowns, Speechly enables users to interact with the application by using voice.
User gets real-time visual feedback on the form as they speak and are encouraged to go on. If there's an error, the user can either correct it by using traditional touch user interface or by voice.

Keywords

FAQs

Package last updated on 27 Nov 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