tessl install tessl/pypi-aiortc@1.13.0Python implementation of WebRTC and ORTC for real-time peer-to-peer communication
Agent Success
Agent success rate when using this tile
87%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.02x
Baseline
Agent success rate without this tile
85%
Build a system that transmits audio data over RTP using WebRTC peer-to-peer connections with capability to monitor transmission statistics and dynamically replace audio sources.
Your implementation should:
@generates
from aiortc import RTCPeerConnection, AudioStreamTrack, RTCConfiguration
class AudioTransmitter:
"""Manages audio transmission over WebRTC RTP."""
def __init__(self, config: RTCConfiguration = None):
"""Initialize the audio transmitter with optional configuration."""
pass
async def start_transmission(self, audio_track: AudioStreamTrack):
"""
Start transmitting an audio track.
Parameters:
- audio_track: The audio track to transmit
"""
pass
async def replace_audio_source(self, new_track: AudioStreamTrack):
"""
Replace the current audio track with a new one without renegotiation.
Parameters:
- new_track: The new audio track to transmit
"""
pass
async def get_transmission_stats(self) -> dict:
"""
Get current transmission statistics.
Returns:
dict with keys:
- packets_sent (int): Number of RTP packets sent
- bytes_sent (int): Total bytes transmitted
"""
pass
def get_supported_audio_codecs(self) -> list:
"""
Get list of supported audio codec names.
Returns:
list of str: Codec names (e.g., ["opus", "PCMU", "PCMA"])
"""
pass
async def close(self):
"""Close the connection and clean up resources."""
passProvides WebRTC implementation including RTCPeerConnection and RTP sender capabilities.
@satisfied-by