homecast

package module
v0.0.0-...-ae646e8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 9 Imported by: 6 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

homecast

Make your speaker speak.

homecast is a Go package to enable text-to-speech on Google Home in local network.

This is Go version of noelportugal/google-home-notifier

Install

$ go get -u github.com/ikasamah/homecast

Usage

ctx := context.Background()
devices := homecast.LookupAndConnect(ctx)

for _, device := range devices {
    err := device.Speak(ctx, "Hello World", "en")
}

Run example

$ go run $GOPATH/src/github.com/ikasamah/homecast/example/main.go

Server erxample

$ go run $GOPATH/src/github.com/ikasamah/homecast/example/server.go

Then, access following URL in your browser.

http://localhost:8080/?text=Ciao&lang=it

Author

Masayuki Hamasaki

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CastDevice

type CastDevice struct {
	*mdns.ServiceEntry
	// contains filtered or unexported fields
}

CastDevice is cast-able device contains cast client

func LookupAndConnect

func LookupAndConnect(ctx context.Context) []*CastDevice

LookupAndConnect retrieves cast-able google home devices

func (*CastDevice) Close

func (g *CastDevice) Close()

Close calls client's close func

func (*CastDevice) Connect

func (g *CastDevice) Connect(ctx context.Context) error

Connect connects required services to cast

func (*CastDevice) Play

func (g *CastDevice) Play(ctx context.Context, url *url.URL) error

Play plays media contents on cast device

func (*CastDevice) Speak

func (g *CastDevice) Speak(ctx context.Context, text, lang string) error

Speak speaks given text on cast device

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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