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

rev_ai

v0.5.1

Published

Unofficial Rev AI Node.js client

Downloads

1

Readme

Node JS client library for REV AI

Provides functions to access Rev AI APIs http://rev.ai.

What is Rev AI?

  • Speech to Text service

Installation

To install, run the following command:

npm install rev_ai --save

If you want to install the latest module directly from Github, use the following command:

npm install git+https://github.com/PacoVu/rev_ai

Include it

var revai = require('rev_ai')
var client = new revai.REVAIClient(rev-ai-apikey, version, proxy)

You can find your API key here after logging in your account.

version Optional parameter (defaults to 'v1beta').

proxy Optional parameter. Set a proxy if you're behind a firewall. Here is an example of initiating the client if you're using proxy:

var revai = require('rev_ai')
var client = new revai.REVAIClient(rev-ai-apikey, 'v1beta', 'http://user:[email protected]:3128')

Call Rev AI endpoints

// Get account info
client.account(function(err,resp,body){
  console.log(body.balance_seconds/60)
})

// Transcribe an audio file from local storage
var params = {
  media: "sample1.mp3",
  metadata: "This is a sample file from local storage"
}
client.transcribe(params, function(err,resp,body){
  console.log(body)
})

// Transcribe an audio file from url
var params = {
  media_url: "http://www.somewhere.com/audio.mp3",
  metadata: "This is a sample file from a remote url"
}
client.transcribe(params, function(err,resp,body){
  console.log(body)
})

// Get transcription jobs
client.getJobs(params, function(err,res,body){
  for (var job of body){
    console.log(job.status)
    console.log(job.id)
    console.log(job.completed_on)
  }
})

// Get a transcription job by job ID
var jobId=12261294
client.getJobById(jobId, function(err,res,body){
  console.log(body)
  if (body.status == "transcribed"){
    // call getTranscription to get the transcription
    // client.getTranscription(body.id, callback)
  }
})

// Get getTranscription
var callback = function(err,resp,body){
  var json = JSON.parse(body)
  var transcript = ""
  for (var item of json.monologues){
    for (var element of item.elements){
      transcript += element.value
    }
  }
  console.log("TRANSCRIPT: " + transcript)
}
client.getTranscription(body.id, callback)

Use POST request

// Transcribe an audio file from local storage
var params = {
  media: "sample1.mp3",
  metadata: "This is a sample file from local storage"
}
client.post('jobs', params, function(err,resp,body){
  console.log(body)
})

// Transcribe an audio file from url
var params = {
  media_url: "http://www.somewhere.com/audio.mp3",
  metadata: "This is a sample file from a remote url"
}
client.post('jobs', params, function(err,resp,body){
  console.log(body)
})

Use GET request

// Get account info
client.get("account", {}, function(err,resp,body){
  console.log(body)
})

// Get a transcription job by job ID
var jobId=12261294
var query = 'jobs/' + jobId
client.get(query, {}, function(err,resp,body){
  console.log(body.status)
  console.log(body.id)
  console.log(body.completed_on)
})

// Get transcription jobs
var params = {
  limit: 2
}
client.get(params, function(err,res,body){
  for (var job of body){
    console.log(job.status)
    console.log(job.id)
    console.log(job.completed_on)
  }
})

// Get get transcription
var jobId=12261294
var query = 'jobs/' + jobId +"/transcript"
client.get(query, "", function(err,resp,body){
  if (!err){
    var json = JSON.parse(body)
    var transcript = ""
    for (var item of json.monologues){
      for (var element of item.elements){
        transcript += element.value
      }
    }
    console.log("TRANSCRIPT: " + transcript)
  }
})