BaseTransport

BaseTransport
base class

Base class for transport implementations that handle audio/video I/O streams.

Constructor Parameters

input_name
Optional[str]
default: "None"

Name identifier for the input stream

output_name
Optional[str]
default: "None"

Name identifier for the output stream

loop
Optional[asyncio.AbstractEventLoop]
default: "None"

Event loop to use for async operations. Defaults to the current running loop.

Methods

input
method

Returns the input frame processor. Must be implemented by subclasses.

@abstractmethod def input(self) -> FrameProcessor
output
method

Returns the output frame processor. Must be implemented by subclasses.

@abstractmethod def output(self) -> FrameProcessor
event_handler
decorator

Decorator to register an event handler for the specified event. python def event_handler(self, event_name: str)

add_event_handler
method

Adds an event handler function for the specified event.

def add_event_handler(self, event_name: str, handler)

TransportParams

TransportParams
class

Configuration parameters for transport audio/video capabilities.

Parameters

Video Output Configuration

camera_out_enabled
bool
default: "False"

Enable camera output

camera_out_is_live
bool
default: "False"

Whether camera output is live streaming

camera_out_width
int
default: "1024"

Camera output width in pixels

camera_out_height
int
default: "768"

Camera output height in pixels

camera_out_bitrate
int
default: "800000"

Camera output bitrate in bits/second

camera_out_framerate
int
default: "30"

Camera output framerate

camera_out_color_format
str
default: "RGB"

Camera output color format

Audio Output Configuration

audio_out_enabled
bool
default: "False"

Enable audio output

audio_out_is_live
bool
default: "False"

Whether audio output is live streaming

audio_out_sample_rate
int
default: "24000"

Audio output sample rate in Hz

audio_out_channels
int
default: "1"

Number of audio output channels

audio_out_bitrate
int
default: "96000"

Audio output bitrate in bits/second

audio_out_mixer
Optional[BaseAudioMixer]
default: "None"

Audio mixer for output processing

Audio Input Configuration

audio_in_enabled
bool
default: "False"

Enable audio input

audio_in_sample_rate
int
default: "16000"

Audio input sample rate in Hz

audio_in_channels
int
default: "1"

Number of audio input channels

audio_in_filter
Optional[BaseAudioFilter]
default: "None"

Audio filter for input processing

VAD Configuration

vad_enabled
bool
default: "False"

Enable Voice Activity Detection

vad_audio_passthrough
bool
default: "False"

When the VAD is enabled, determines whether to pass through audio frames. This is required in order to pass through audio if you’re using an STT service and have the VAD enabled.

vad_analyzer
Optional[VADAnalyzer]
default: "None"

Voice Activity Detection analyzer. You can set this to either SileroVADAnalyzer() or WebRTCVADAnalyzer().