🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@project-sunbird/open-speech-streaming-client

Package Overview
Dependencies
Maintainers
9
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@project-sunbird/open-speech-streaming-client

Streaming client library for EkStep open speech API

Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
111
70.77%
Maintainers
9
Weekly downloads
 
Created
Source

Client library for Open Speech API

This package contains a client lib to provide real-time streaming functionality for Open Speech API https://open-speech-ekstep.github.io/.

How to use it

Step 1: Install the package

npm i @project-sunbird/open-speech-streaming-client

Step 2: Connect to socket and stream

import {StreamingClient,SocketStatus} from '@project-sunbird/open-speech-streaming-client'

//Create instance of streaming client.
const streamingClient= new StreamingClient();

//Connect to inferencing server
streaming.connect('<inferencing-server-url>', 'en-IN'/* langugaue*/, function (action, id) {
    if (action === SocketStatus.CONNECTED) {
        // Once connection is succesful, start streaming
        streaming.startStreaming(function (transcript) {
            // transcript will give you the text which can be used further
            console.log('transcript:', transcript);
        }, (e) => {
            console.log("I got error", e);
        })
    } else {
        //unexpected failures action on connect.
        console.log("Action", action, id)
    }
})

Punctuation

You can punctuate a text using the punctuation endpoint.

streaming.punctuateText('Text to punctuate', '<inferencing-server-url>', (status, text) => {
    console.log("Punctuted Text:", text);
}, (status, error) => {
    console.log("Failed to punctuate", status, error);
});

SocketStatus

SocketStatus has two possible states.CONNECTED and TERMINATED

Keywords

streaming

FAQs

Package last updated on 28 Oct 2021

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