gobot: gobot.io/x/gobot/platforms/audio Index | Files

package audio

import "gobot.io/x/gobot/platforms/audio"

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

Package Files

audio_adaptor.go audio_driver.go doc.go

func CommandName Uses

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 Uses

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

type Adaptor Uses

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

Adaptor is gobot Adaptor connection to audio playback

func NewAdaptor Uses

func NewAdaptor() *Adaptor

NewAdaptor returns a new audio Adaptor

func (*Adaptor) Connect Uses

func (a *Adaptor) Connect() error

Connect establishes a connection to the Audio adaptor

func (*Adaptor) Finalize Uses

func (a *Adaptor) Finalize() error

Finalize terminates the connection to the Audio adaptor

func (*Adaptor) Name Uses

func (a *Adaptor) Name() string

Name returns the Adaptor Name

func (*Adaptor) SetName Uses

func (a *Adaptor) SetName(n string)

SetName sets the Adaptor Name

func (*Adaptor) Sound Uses

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

Sound plays a sound and accepts:

string: The filename of the audio to start playing

type Driver Uses

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

Driver is gobot software device for audio playback

func NewDriver Uses

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 Uses

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

Connection returns the Driver Connection

func (*Driver) Filename Uses

func (d *Driver) Filename() string

Filename returns the file name for the driver to playback

func (*Driver) Halt Uses

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

Halt halts the Driver

func (*Driver) Name Uses

func (d *Driver) Name() string

Name returns the Driver Name

func (*Driver) Play Uses

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

Play plays back the current sound file.

func (*Driver) SetName Uses

func (d *Driver) SetName(n string)

SetName sets the Driver Name

func (*Driver) Sound Uses

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 Uses

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

Start starts the Driver

Package audio imports 7 packages (graph). Updated 2019-02-26. Refresh now. Tools for package owners.