audio

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 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

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

Adaptor is gobot Adaptor connection to audio playback

func NewAdaptor

func NewAdaptor() *Adaptor

NewAdaptor returns a new audio Adaptor

func (*Adaptor) Connect

func (a *Adaptor) Connect() error

Connect establishes a connection to the Audio adaptor

func (*Adaptor) Finalize

func (a *Adaptor) Finalize() error

Finalize terminates the connection to the Audio adaptor

func (*Adaptor) Name

func (a *Adaptor) Name() string

Name returns the Adaptor Name

func (*Adaptor) SetName

func (a *Adaptor) SetName(n string)

SetName sets the Adaptor Name

func (*Adaptor) Sound

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

Sound plays a sound and accepts:

string: The filename of the audio to start playing

type Driver

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

Driver is gobot software device for audio playback

func NewDriver

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

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

Connection returns the Driver Connection

func (*Driver) Filename

func (d *Driver) Filename() string

Filename returns the file name for the driver to playback

func (*Driver) Halt

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

Halt halts the Driver

func (*Driver) Name

func (d *Driver) Name() string

Name returns the Driver Name

func (*Driver) Play

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

Play plays back the current sound file.

func (*Driver) SetName

func (d *Driver) SetName(n string)

SetName sets the Driver Name

func (*Driver) Sound

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

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

Start starts the Driver

Jump to

Keyboard shortcuts

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