audioinput

package
v0.30.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package audioinput defines an audio capturing device.

Index

Constants

View Source
const SubtypeName = "audio_input"

SubtypeName is a constant that identifies the audio input resource subtype string.

Variables

View Source
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)

API is a variable that identifies the audio input resource API.

View Source
var HostEndian binary.ByteOrder

HostEndian indicates the byte ordering this host natively uses.

Functions

func Named

func Named(name string) resource.Name

Named is a helper for getting the named audio inputs's typed resource name.

func NamesFromRobot

func NamesFromRobot(r robot.Robot) []string

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 logging.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

Jump to

Keyboard shortcuts

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