Skip to main content

Media

Media Manager

reachy_mini.media.media_manager.MediaManager

MediaManager class for managing audio and video streams on the Reachy Mini robot.

Methods

start_audio

Start the audio stream.


stop_audio

Stop the audio stream.


start_video

Start the video stream.


stop_video

Stop the video stream.


Audio

reachy_mini.media.audio_base.AudioBase

Base class for audio handling on Reachy Mini.

Methods

play_sound

Play a sound file.

Parameters:

NameTypeDescription
file_pathstrPath to the sound file to play.

set_volume

Set the audio volume.

Parameters:

NameTypeDescription
volumeintVolume level (0-100).

get_volume

Get the current audio volume.

Returns:

int — Current volume level (0-100).


reachy_mini.media.audio_gstreamer.GStreamerAudio

GStreamer-based audio implementation for Reachy Mini.

Methods

start_recording

Start audio recording.


stop_recording

Stop audio recording.


get_audio_stats

Get audio statistics.

Returns:

Dict — Dictionary containing audio statistics.


Audio Utils Functions

reachy_mini.media.audio_utils.get_respeaker_card_number

Get the card number for the ReSpeaker device.

Returns:

int — The ALSA card number for the ReSpeaker.


reachy_mini.media.audio_utils.has_reachymini_asoundrc

Check if the Reachy Mini asoundrc configuration file exists.

Returns:

bool — True if the configuration file exists.


reachy_mini.media.audio_utils.check_reachymini_asoundrc

Check if the Reachy Mini asoundrc configuration is valid.

Returns:

bool — True if the configuration is valid.


reachy_mini.media.audio_utils.write_asoundrc_to_home

Write the asoundrc configuration to the user's home directory.


Audio Control Utils Functions

reachy_mini.media.audio_control_utils.ReSpeaker

ReSpeaker USB microphone array controller.

Methods

set_channel

Set the active channel for the ReSpeaker.

Parameters:

NameTypeDescription
channelintChannel number to set as active.

get_volume

Get the microphone volume.

Returns:

int — Current microphone volume (0-100).


set_volume

Set the microphone volume.

Parameters:

NameTypeDescription
volumeintVolume level (0-100).

reachy_mini.media.audio_control_utils.find

Find connected ReSpeaker devices.

Returns:

List[ReSpeaker] — List of found ReSpeaker devices.


reachy_mini.media.audio_control_utils.init_respeaker_usb

Initialize the ReSpeaker USB microphone.

Returns:

ReSpeaker — Initialized ReSpeaker device.


Camera

reachy_mini.media.camera_gstreamer.GStreamerCamera

GStreamer-based camera implementation for Reachy Mini.

Methods

start

Start the camera stream.


stop

Stop the camera stream.


get_frame

Get the current camera frame.

Returns:

np.ndarray — Current camera frame as a numpy array.


undistort_points

Undistort image points using camera calibration parameters.

Parameters:

NameTypeDescription
pointsnp.ndarrayInput points to undistort.
camera_matrixnp.ndarrayCamera intrinsic matrix.
dist_coeffsnp.ndarrayDistortion coefficients.

Returns:

np.ndarray — Undistorted points.


Camera Utils Functions

reachy_mini.media.camera_utils.undistort_points

Undistort points using camera calibration parameters.

Parameters:

NameTypeDescription
pointsnp.ndarrayInput points to undistort.
camera_matrixnp.ndarrayCamera intrinsic matrix.
dist_coeffsnp.ndarrayDistortion coefficients.

Returns:

np.ndarray — Undistorted points.


reachy_mini.media.camera_utils.scale_intrinsics

Scale camera intrinsic parameters for different image resolutions.

Parameters:

NameTypeDescription
intrinsicsnp.ndarrayOriginal camera intrinsic matrix.
scale_factorfloatScale factor for the intrinsics.

Returns:

np.ndarray — Scaled camera intrinsic matrix.


Camera Constants

reachy_mini.media.camera_constants.CameraResolution

Camera resolution configuration class.

Properties

PropertyTypeDescription
widthintImage width in pixels.
heightintImage height in pixels.

reachy_mini.media.camera_constants.CameraSpecs

Base class for camera specifications.

Properties

PropertyTypeDescription
resolutionCameraResolutionCamera resolution.
frame_rateintFrame rate in fps.
camera_matrixnp.ndarrayCamera intrinsic matrix.
dist_coeffsnp.ndarrayDistortion coefficients.

reachy_mini.media.camera_constants.ArducamSpecs

Specifications for the Arducam camera module.


reachy_mini.media.camera_constants.ReachyMiniLiteCamSpecs

Specifications for the Reachy Mini Lite camera.


reachy_mini.media.camera_constants.ReachyMiniWirelessCamSpecs

Specifications for the Reachy Mini Wireless camera.


reachy_mini.media.camera_constants.OlderRPiCamSpecs

Specifications for older Raspberry Pi camera modules.


reachy_mini.media.camera_constants.MujocoCameraSpecs

Specifications for the MuJoCo simulation camera.


reachy_mini.media.camera_constants.GenericWebcamSpecs

Specifications for generic USB webcams.


WebRTC

reachy_mini.media.webrtc_client_gstreamer.GstWebRTCClient

WebRTC client using GStreamer for streaming audio and video.

Methods

connect

Connect to the signaling server.

Parameters:

NameTypeDescription
signaling_urlstrURL of the signaling server.
tokenstrAuthentication token.

disconnect

Disconnect from the signaling server.


start_stream

Start streaming audio and video.


stop_stream

Stop streaming audio and video.


attach_video

Attach a video element to receive the stream.

Parameters:

NameTypeDescription
video_elementHTMLVideoElementVideo element to attach.

set_audio_muted

Mute or unmute the audio.

Parameters:

NameTypeDescription
mutedboolWhether to mute the audio.

reachy_mini.media.media_server.GstMediaServer

GStreamer-based media server for handling WebRTC streams.

Methods

start

Start the media server.


stop

Stop the media server.


create_offer

Create a WebRTC offer for incoming connections.

Returns:

str — SDP offer string.


handle_answer

Handle a WebRTC answer from a client.

Parameters:

NameTypeDescription
answerstrSDP answer from the client.

add_track

Add a media track to the connection.

Parameters:

NameTypeDescription
trackMediaStreamTrackMedia track to add.

remove_track

Remove a media track from the connection.

Parameters:

NameTypeDescription
trackMediaStreamTrackMedia track to remove.
Loading Comments...