api

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2018 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package api provides methods to contact the Aurora API and process the given requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTTS

func GetTTS(c *config.Config, text string) (*audio.File, error)

GetTTS calls the TTS API given some text and returns an *audio.File with the audio from converting the text to speech.

Types

type InterpretResponse

type InterpretResponse struct {
	// Text is the original query
	Text string `json:"text"`

	// Intent is the intent of the user. It is an empty string if the
	// user's intent was unclear
	Intent string `json:"intent"`

	// Entities is a map of the entities in the user's query. The keys
	// are the entity name (like song or location) and the value
	// is the detected value for that entitity
	Entities map[string]string `json:"entities"`
}

InterpretResponse is the response returned by the API if the text was successfully able to be interpreted.

func GetInterpret

func GetInterpret(c *config.Config, text string) (*InterpretResponse, error)

GetInterpret queries the API with the provided text and returns the interpreted response.

type STTResponse

type STTResponse struct {
	Transcript string `json:"transcript"`
}

STTResponse is the response returned by the API if the speech was successfully able to be transcribed.

func GetSTT

func GetSTT(c *config.Config, audio *audio.File) (*STTResponse, error)

GetSTT queries the API with the provided audio file and returns a transcript of the speech.

func GetSTTFromStream

func GetSTTFromStream(c *config.Config, audio io.Reader) (*STTResponse, error)

GetSTTFromStream queries the API with the provided raw WAV audio stream and returns a transcript of the speech.

Directories

Path Synopsis
Package backend provides a generic interface to make calls to the Aurora backend.
Package backend provides a generic interface to make calls to the Aurora backend.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL