šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

github.com/nuveo/speech-to-text

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/nuveo/speech-to-text

v0.0.0-20170616035640-d52bb957938a
Source
Go
Version published
Created
Source

Speech to Text

IBM Bluemix, the Speech to Text service converts the human voice into the written word.

Install

go get github.com/nuveo/speech-to-text

Export to env SPEECH_USERNAME and SPEECH_PASSWORD.

credentials getting in dashboard

Usage

bin

cd $GOPATH/src/github.com/nuveo/speech-to-text/speech
go build
./speech -input /path/to/audio/file

Code

package main

import (
	"flag"
	"fmt"
	"log"

	"github.com/nuveo/speech-to-text"
)

var (
	inputFile = flag.String("input", "", "File to convert into text")
)

func main() {
	flag.Parse()

	if *inputFile != "" {
		c := speech.Credentials{}
		c.Setup()

		url := c.MakeSessionURL()
		sess, err := speech.GetSession(url)
		if err != nil {
			return
		}

		status, err := sess.GetRecognize()
		if err != nil {
			return
		}

		if status.Session.State != "initialized" {
			log.Println("Not ready yet, got:", status.Session.State)
			return
		}

		text, err := sess.SendAudio(*inputFile)
		if err != nil {
			return
		}

		fmt.Println(text)
		sess.DeleteSession()
	}
}

FAQs

Package last updated on 16 Jun 2017

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