:py:mod:`viam.proto.component.audioinput` ========================================= .. py:module:: viam.proto.component.audioinput .. autoapi-nested-parse:: @generated by Viam. Do not edit manually! Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: viam.proto.component.audioinput.AudioInputServiceBase viam.proto.component.audioinput.AudioInputServiceStub viam.proto.component.audioinput.UnimplementedAudioInputServiceBase viam.proto.component.audioinput.AudioChunk viam.proto.component.audioinput.AudioChunkInfo viam.proto.component.audioinput.ChunksRequest viam.proto.component.audioinput.ChunksResponse viam.proto.component.audioinput.PropertiesRequest viam.proto.component.audioinput.PropertiesResponse viam.proto.component.audioinput.RecordRequest viam.proto.component.audioinput.SampleFormat .. py:class:: AudioInputServiceBase Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:method:: Chunks(stream: grpclib.server.Stream[component.audioinput.v1.audioinput_pb2.ChunksRequest, component.audioinput.v1.audioinput_pb2.ChunksResponse]) -> None :abstractmethod: :async: .. py:method:: Properties(stream: grpclib.server.Stream[component.audioinput.v1.audioinput_pb2.PropertiesRequest, component.audioinput.v1.audioinput_pb2.PropertiesResponse]) -> None :abstractmethod: :async: .. py:method:: Record(stream: grpclib.server.Stream[component.audioinput.v1.audioinput_pb2.RecordRequest, google.api.httpbody_pb2.HttpBody]) -> None :abstractmethod: :async: .. py:method:: DoCommand(stream: grpclib.server.Stream[common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse]) -> None :abstractmethod: :async: .. py:method:: GetGeometries(stream: grpclib.server.Stream[common.v1.common_pb2.GetGeometriesRequest, common.v1.common_pb2.GetGeometriesResponse]) -> None :abstractmethod: :async: .. py:method:: __mapping__() -> Dict[str, grpclib.const.Handler] .. py:class:: AudioInputServiceStub(channel: grpclib.client.Channel) .. py:class:: UnimplementedAudioInputServiceBase Bases: :py:obj:`AudioInputServiceBase` Helper class that provides a standard way to create an ABC using inheritance. .. py:method:: Chunks(stream: grpclib.server.Stream[component.audioinput.v1.audioinput_pb2.ChunksRequest, component.audioinput.v1.audioinput_pb2.ChunksResponse]) -> None :async: .. py:method:: Properties(stream: grpclib.server.Stream[component.audioinput.v1.audioinput_pb2.PropertiesRequest, component.audioinput.v1.audioinput_pb2.PropertiesResponse]) -> None :async: .. py:method:: Record(stream: grpclib.server.Stream[component.audioinput.v1.audioinput_pb2.RecordRequest, google.api.httpbody_pb2.HttpBody]) -> None :async: .. py:method:: DoCommand(stream: grpclib.server.Stream[common.v1.common_pb2.DoCommandRequest, common.v1.common_pb2.DoCommandResponse]) -> None :async: .. py:method:: GetGeometries(stream: grpclib.server.Stream[common.v1.common_pb2.GetGeometriesRequest, common.v1.common_pb2.GetGeometriesResponse]) -> None :async: .. py:class:: AudioChunk(*, data: bytes = ..., length: int = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: data :type: bytes Data is PCM data that is organized according to the sample format along with its possible interleaving. Data in each format is Little Endian. .. py:attribute:: length :type: int Length is the number of samples .. py:class:: AudioChunkInfo(*, sample_format: global___SampleFormat = ..., channels: int = ..., sampling_rate: int = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: sample_format :type: global___SampleFormat Actual sample encoding format of the response .. py:attribute:: channels :type: int .. py:attribute:: sampling_rate :type: int .. py:class:: ChunksRequest(*, name: str = ..., sample_format: global___SampleFormat = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: name :type: str Name of an audio input .. py:attribute:: sample_format :type: global___SampleFormat Requested sample encoding format of the response .. py:class:: ChunksResponse(*, info: global___AudioChunkInfo | None = ..., chunk: global___AudioChunk | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: info :type: global___AudioChunkInfo .. py:property:: chunk :type: global___AudioChunk .. py:method:: HasField(field_name: Literal[chunk, b'chunk', info, b'info', type, b'type']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:method:: WhichOneof(oneof_group: Literal[type, b'type']) -> Literal[info, chunk] | None Returns the name of the field that is set inside a oneof group. If no field is set, returns None. :param oneof_group: the name of the oneof group to check. :type oneof_group: str :returns: The name of the group that is set, or None. :rtype: str or None :raises ValueError: no group with the given name exists .. py:class:: PropertiesRequest(*, name: str = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:attribute:: name :type: str Name of an audio input .. py:class:: PropertiesResponse(*, channel_count: int = ..., latency: google.protobuf.duration_pb2.Duration | None = ..., sample_rate: int = ..., sample_size: int = ..., is_big_endian: bool = ..., is_float: bool = ..., is_interleaved: bool = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: latency :type: google.protobuf.duration_pb2.Duration .. py:attribute:: channel_count :type: int .. py:attribute:: sample_rate :type: int .. py:attribute:: sample_size :type: int .. py:attribute:: is_big_endian :type: bool .. py:attribute:: is_float :type: bool .. py:attribute:: is_interleaved :type: bool .. py:method:: HasField(field_name: Literal[latency, b'latency']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:class:: RecordRequest(*, name: str = ..., duration: google.protobuf.duration_pb2.Duration | None = ...) Bases: :py:obj:`google.protobuf.message.Message` Abstract base class for protocol messages. Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below. .. py:property:: duration :type: google.protobuf.duration_pb2.Duration .. py:attribute:: name :type: str Name of an audio input .. py:method:: HasField(field_name: Literal[duration, b'duration']) -> bool Checks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. :param field_name: The name of the field to check for presence. :type field_name: str :returns: Whether a value has been set for the named field. :rtype: bool :raises ValueError: if the `field_name` is not a member of this message. .. py:class:: SampleFormat Bases: :py:obj:`_SampleFormat`