audio

package
Version: v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package audio is based on aplay audio adaptor written by @colemanserious (https://github.com/colemanserious)

Package audio is based on aplay audio adaptor written by @colemanserious (https://github.com/colemanserious)

Package audio provides the Gobot adaptor for audio.

For more information refer to the README: https://github.com/hybridgroup/gobot/blob/master/platforms/audio/README.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandName

func CommandName(fileName string) (commandName string, err error)

CommandName defines the playback command for a sound and accepts:

string: The filename of the audio that needs playback

func RunCommand

func RunCommand(audioCommand string, filename string) error

RunCommand executes the playback command for a sound file and accepts:

string: The audio command to be use for playback
string: The filename of the audio that needs playback

Types

type Adaptor added in v1.0.0

type Adaptor struct {
	// contains filtered or unexported fields
}

Adaptor is gobot Adaptor connection to audio playback

func NewAdaptor added in v1.0.0

func NewAdaptor() *Adaptor

NewAdaptor returns a new audio Adaptor

func (*Adaptor) Connect added in v1.0.0

func (a *Adaptor) Connect() error

Connect establishes a connection to the Audio adaptor

func (*Adaptor) Finalize added in v1.0.0

func (a *Adaptor) Finalize() error

Finalize terminates the connection to the Audio adaptor

func (*Adaptor) Name added in v1.0.0

func (a *Adaptor) Name() string

Name returns the Adaptor Name

func (*Adaptor) SetName added in v1.0.0

func (a *Adaptor) SetName(n string)

SetName sets the Adaptor Name

func (*Adaptor) Sound added in v1.0.0

func (a *Adaptor) Sound(fileName string) []error

Sound plays a sound and accepts:

string: The filename of the audio to start playing

type Driver added in v1.0.0

type Driver struct {
	gobot.Eventer
	gobot.Commander
	// contains filtered or unexported fields
}

Driver is gobot software device for audio playback

func NewDriver added in v1.0.0

func NewDriver(a *Adaptor, filename string) *Driver

NewDriver returns a new audio Driver. It accepts:

*Adaptor: The audio adaptor to use for the driver

string: The filename of the audio to start playing

func (*Driver) Connection added in v1.0.0

func (d *Driver) Connection() gobot.Connection

Connection returns the Driver Connection

func (*Driver) Filename added in v1.0.0

func (d *Driver) Filename() string

Filename returns the file name for the driver to playback

func (*Driver) Halt added in v1.0.0

func (d *Driver) Halt() (err error)

Halt halts the Driver

func (*Driver) Name added in v1.0.0

func (d *Driver) Name() string

Name returns the Driver Name

func (*Driver) Play added in v1.0.0

func (d *Driver) Play() []error

Play plays back the current sound file.

func (*Driver) SetName added in v1.0.0

func (d *Driver) SetName(n string)

SetName sets the Driver Name

func (*Driver) Sound added in v1.0.0

func (d *Driver) Sound(fileName string) []error

Sound plays back a sound file. It accepts:

string: The filename of the audio to start playing

func (*Driver) Start added in v1.0.0

func (d *Driver) Start() (err error)

Start starts the Driver

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL