npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sber-salute-speech-recognition

v2.2.0

Published

A library that produces audio transcriptions using the SBER Salute Speech service.

Downloads

12

Readme

sber-salute-speech-recognition

A library for getting audio transcriptions from the SBER Salute Speech service https://developers.sber.ru/docs/ru/salutespeech/recognition/recognition-sync.

Getting started

  1. Create an account on https://developers.sber.ru/portal/products/smartspeech
  2. Generate a client secret
  3. Capture the auth key

Install

npm install sber-salute-speech-recognition

Usage

import {
  SberSaluteSpeechRecognitionService,
  AudioEncoding,
} from 'sber-salute-speech-recognition';

const recognitionService = new SberSaluteSpeechRecognitionService(AUTH_KEY);
const { text, normalizedText } = await recognitionService.speechToText(
  pathToAudioFile,
  AudioEncoding.MP3,
);

AccessToken Scope

The scope property is set during the instantiation of the SberSaluteSpeechRecognitionService class. If no value is provided, it defaults to Scope.Personal.

Here is an example of how to use the scope property:

import {
  SberSaluteSpeechRecognitionService,
  Scope,
} from 'sber-salute-speech-recognition';

const service = new SberSaluteSpeechRecognitionService(
  AUTH_KEY,
  undefined,
  Scope.Corporate
);

In this example, the scope property is set to Scope.Corporate what equals SALUTE_SPEECH_CORP. If you want to use the SALUTE_SPEECH_PERS scope, you can either pass Scope.Personal as the third argument or omit the third argument entirely, as it defaults to Scope.Personal.

Hints param

For improve speech recognition you can pass in speechToText method hints param

Here is example of how to use the hints param:

import {
  SberSaluteSpeechRecognitionService,
  AudioEncoding,
} from 'sber-salute-speech-recognition';

const recognitionService = new SberSaluteSpeechRecognitionService(AUTH_KEY);
const { text, normalizedText } = await recognitionService.speechToText(
  pathToAudioFile,
  AudioEncoding.MP3,
  {
    words: ['card', 'name'],
    enable_letters: true,
    eou_timeout: "2s"
  }
);

In this example , we pass object with props words, enable_letters, eou_timeout.

words - A list of words or phrases whose recognition we want to strengthen. Here you can list the words that the user is likely to pronounce

enable_letters - A short phrase model that improves recognition of single letters and short words. Possible values: true and false

eou_timeout - Setting up recognition of the end of a phrase (End of Utterance - eou). Such recognition will be expected after the end of the phrase for as many seconds as set in this parameter. Possible values are from 0.5 to 5 seconds.

Channels count

The channels_count allows to override the number of channels to recognize in the audio file. If not specified, the number of channels will be determined automatically.

Possible values: undefined - channels count will be determined automatically 1 - mono 2 - stereo

import {
  SberSaluteSpeechRecognitionService,
  AudioEncoding,
} from 'sber-salute-speech-recognition';

const recognitionService = new SberSaluteSpeechRecognitionService(AUTH_KEY);
const { text, normalizedText } = await recognitionService.speechToText(
  pathToAudioFile,
  AudioEncoding.MP3,
  1
);

In this example we set channels count to 1.