1.15.6 • Published 8 months ago

olaris-speech-recog-stream v1.15.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

olaris-speech-recog-stream

A simple stream object to be used with Olaris Speech Recog API

Installation

npm install olaris-speech-recog-stream

Usage

const tl = require('tracing-log')
const OlarisSpeechRecogStream = require('olaris-speech-recog-stream')

const config = {
    api_base: 'OLARIS_API_BASE',
    product_name: 'YOUR_PRODUCT_NAME',
    organization_id: 'YOUR_ORGANIZATION_ID',
    api_key: 'YOUR_API_KEY',

    encoding: 'LINEAR16', // it can be LINEAR16, MULAW or ALAW
    sampling_rate: 16000, // it can be 16000 (for LINEAR16) or 8000 (for MULAW and ALAW)
}

const language = 'ja-JP' // Olaris currently only supports Japanese
const context = null // Currently this has no use (later it will be used to permit to specify grammar/keywords to improve accuracy)

// you need to provide a log object 
const uuid = 'SOME_UNIQUE_IDENTIFIER_FOR_DEBUG_AND_CORRELATION'
const log = tl.gen_logger(uuid)

const ola_stream = new OlarisSpeechRecogStream(language, context, config, log)

ola_stream.on('data', data => {
    log.info(`ola_stream ${uuid} Channel=1 Transcription: ${data.transcript}`)
})

ola_stream.on('close', () => {
    log.info(`ola_stream ${uuid} close`)
})

ola_stream.on('error', err => {
    log.error(`ola_stream ${uuid} error ${err}`)
})

// then you can pipe data to it
someReadStream.pipe(ola_stream)

// or write to it
ola_stream.write(SOME_DATA)

```
1.15.0

12 months ago

1.15.3

12 months ago

1.15.1

12 months ago

1.15.6

8 months ago

1.15.5

12 months ago

1.14.0

12 months ago

1.13.1

12 months ago

1.13.0

12 months ago

1.12.0

1 year ago

1.10.2

1 year ago

1.9.0

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.11.0

1 year ago

1.10.1

1 year ago

1.10.0

1 year ago

1.6.0

1 year ago

1.5.3

1 year ago

1.5.2

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago