Skip to content

Microphone

A microphone object represents the physical microphone of a device integrated into Netsocs. Its function is to capture audio in real time and transmit it as an RTP stream to the platform, enabling remote audio monitoring or event recording.

Unlike a sensor, a microphone does not deliver discrete data points but a continuous audio stream. Its lifecycle alternates between idle (not transmitting) and actively streaming (an audio session is in progress).

Main characteristics

  • Real-time audio capture: Transmits RTP packets from the device to DriversHub.
  • Managed sessions: Each audio session has a unique identifier (session_id) that allows streams to be opened and closed independently.
  • Audio configuration: The object exposes media profile parameters from the device (codec, sample rate, channels).

Common use cases

  • Audio monitoring of industrial or security facilities.
  • Audio recording associated with video events (IP cameras with built-in microphone).
  • Acoustic anomaly detection through automations that react to the streaming state.
  • Two-way communication systems combined with a speaker object.

States

State Description
microphone.state.idle The microphone is available but not transmitting.
microphone.state.streaming An active audio session is in progress.

Actions

Action Description
microphone.action.start_stream Starts an audio capture session. Requires session_id in the payload.
microphone.action.stop_stream Stops the active audio session for the given session_id.

State properties

Property Description
profile_token Device media profile token.
source_token Audio source token on the device.
codec Audio codec in use (e.g. G711, G726, AAC).
sample_rate Sampling frequency in Hz (e.g. 8000).
channels Number of audio channels (e.g. 1 for mono).