Documentation ¶
Overview ¶
Package audioinput defines an audio capturing device.
Index ¶
- Constants
- Variables
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewRPCServiceServer(coll resource.APIResourceCollection[AudioInput]) interface{}
- type AudioInput
- func FromAudioSource(name resource.Name, src AudioSource) (AudioInput, error)
- func FromDependencies(deps resource.Dependencies, name string) (AudioInput, error)
- func FromRobot(r robot.Robot, name string) (AudioInput, error)
- func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, remoteName string, ...) (AudioInput, error)
- type AudioSource
- type LivenessMonitor
Constants ¶
const SubtypeName = "audio_input"
SubtypeName is a constant that identifies the audio input resource subtype string.
Variables ¶
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
API is a variable that identifies the audio input resource API.
var HostEndian binary.ByteOrder
HostEndian indicates the byte ordering this host natively uses.
Functions ¶
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all audio input names from the given Robot.
func NewRPCServiceServer ¶ added in v0.2.36
func NewRPCServiceServer(coll resource.APIResourceCollection[AudioInput]) interface{}
NewRPCServiceServer constructs an audio input gRPC service server. It is intentionally untyped to prevent use outside of tests.
Types ¶
type AudioInput ¶
type AudioInput interface { resource.Resource AudioSource }
An AudioInput is a resource that can capture audio.
func FromAudioSource ¶ added in v0.2.36
func FromAudioSource(name resource.Name, src AudioSource) (AudioInput, error)
FromAudioSource creates an AudioInput resource either from a AudioSource.
func FromDependencies ¶
func FromDependencies(deps resource.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, remoteName string, name resource.Name, logger golog.Logger, ) (AudioInput, error)
NewClientFromConn constructs a new Client from connection passed in.
type AudioSource ¶ added in v0.2.36
type AudioSource interface { gostream.AudioSource gostream.AudioPropertyProvider }
An AudioSource represents anything that can capture audio.
func NewAudioSourceFromGostreamSource ¶ added in v0.2.36
func NewAudioSourceFromGostreamSource(audSrc gostream.AudioSource) (AudioSource, error)
NewAudioSourceFromGostreamSource creates an AudioSource from a gostream.AudioSource.
func NewAudioSourceFromReader ¶ added in v0.2.36
func NewAudioSourceFromReader(reader gostream.AudioReader, props prop.Audio) (AudioSource, error)
NewAudioSourceFromReader creates an AudioSource from a reader.
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 API specific functions
|
Package register registers all relevant audio inputs and also API specific functions |