Documentation ¶
Overview ¶
Package audioinput defines an audio capturing device.
Index ¶
- Constants
- Variables
- func DependencyTypeError(name string, actual interface{}) error
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewServer(s subtype.Service) pb.AudioInputServiceServer
- func NewUnimplementedInterfaceError(actual interface{}) error
- func WrapWithReconfigurable(r interface{}, name resource.Name) (resource.Reconfigurable, error)
- type AudioInput
- func FromDependencies(deps registry.Dependencies, name string) (AudioInput, error)
- func FromRobot(r robot.Robot, name string) (AudioInput, error)
- func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) AudioInput
- func NewFromReader(reader gostream.AudioReader, props prop.Audio) (AudioInput, error)
- func NewFromSource(audSrc gostream.AudioSource) (AudioInput, error)
- type LivenessMonitor
Constants ¶
const SubtypeName = resource.SubtypeName("audio_input")
SubtypeName is a constant that identifies the audio input resource subtype string.
Variables ¶
var HostEndian binary.ByteOrder
HostEndian indicates the byte ordering this host natively uses.
var Subtype = resource.NewSubtype( resource.ResourceNamespaceRDK, resource.ResourceTypeComponent, SubtypeName, )
Subtype is a constant that identifies the audio input resource subtype.
Functions ¶
func DependencyTypeError ¶
DependencyTypeError is used when a resource doesn't implement the expected interface.
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all audio input names from the given Robot.
func NewServer ¶
func NewServer(s subtype.Service) pb.AudioInputServiceServer
NewServer constructs an audio input gRPC service server.
func NewUnimplementedInterfaceError ¶
func NewUnimplementedInterfaceError(actual interface{}) error
NewUnimplementedInterfaceError is used when there is a failed interface check.
func WrapWithReconfigurable ¶
func WrapWithReconfigurable(r interface{}, name resource.Name) (resource.Reconfigurable, error)
WrapWithReconfigurable wraps an audio input with a reconfigurable and locking interface.
Types ¶
type AudioInput ¶
type AudioInput interface { gostream.AudioSource gostream.AudioPropertyProvider generic.Generic }
An AudioInput represents anything that can capture audio.
func FromDependencies ¶
func FromDependencies(deps registry.Dependencies, name string) (AudioInput, error)
FromDependencies is a helper for getting the named audio input from a collection of dependencies.
func FromRobot ¶
func FromRobot(r robot.Robot, name string) (AudioInput, error)
FromRobot is a helper for getting the named audio input from the given Robot.
func NewClientFromConn ¶
func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) AudioInput
NewClientFromConn constructs a new Client from connection passed in.
func NewFromReader ¶
func NewFromReader(reader gostream.AudioReader, props prop.Audio) (AudioInput, error)
NewFromReader creates an AudioInput from a reader.
func NewFromSource ¶
func NewFromSource(audSrc gostream.AudioSource) (AudioInput, error)
NewFromSource creates an AudioInput from an AudioSource.
type LivenessMonitor ¶ added in v0.2.18
type LivenessMonitor interface {
Monitor(notifyReset func())
}
A LivenessMonitor is responsible for monitoring the liveness of an audio input. An example is connectivity. Since the model itself knows best about how to maintain this state, the reconfigurable offers a safe way to notify if a state needs to be reset due to some exceptional event (like a reconnect). It is expected that the monitoring code is tied to the lifetime of the resource and once the resource is closed, so should the monitor. That is, it should no longer send any resets once a Close on its associated resource has returned.
Directories ¶
Path | Synopsis |
---|---|
Package fake implements a fake audio input.
|
Package fake implements a fake audio input. |
Package microphone implements a microphone audio input.
|
Package microphone implements a microphone audio input. |
Package register registers all relevant audio inputs and also subtype specific functions
|
Package register registers all relevant audio inputs and also subtype specific functions |