application

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildVersion string
	BuildTime    string
)

Build flags, set by ldflags.

Functions

func GetAPIToken

func GetAPIToken(
	ctx context.Context, path string, identityURL url.URL, appID, deviceID uuid.UUID, log logger.Logger,
) (speechly.AccessToken, error)

GetAPIToken fetches Speechly API token from a cache file or refreshes it by calling Speechly Identity API.

func NewLogger

func NewLogger(out io.Writer, level logrus.Level) logger.Logger

NewLogger returns a new logger that writes to out with specified level.

func RecogniseFiles

func RecogniseFiles(
	ctx context.Context, cfg Config, token speechly.AccessToken, paths []string, dst io.Writer,
	enableTentative bool, bufSize int, log logger.Logger,
) error

RecogniseFiles uses Speechly API to recognise audio from WAV files stored on disk.

func RecogniseMicrophone

func RecogniseMicrophone(
	ctx context.Context, cfg Config, fmt audio.Format, token speechly.AccessToken, dst io.Writer,
	enableTentative bool, bufSize int, log logger.Logger,
) error

RecogniseMicrophone uses Speechly SLU API to recognise audio from the microphone.

Types

type Config

type Config struct {
	SluURL       url.URL
	IdentityURL  url.URL
	AppID        uuid.UUID
	DeviceID     uuid.UUID
	LanguageCode language.Tag
	// contains filtered or unexported fields
}

Config is the configuration of the CLI app.

func (*Config) IsValid

func (c *Config) IsValid() bool

IsValid returns true if the config is valid and false otherwise.

func (*Config) Parse

func (c *Config) Parse(sluURL, identityURL, appID, deviceID, languageCode string) error

Parse parses the config from provided string values.

Jump to

Keyboard shortcuts

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