or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/aiortc@1.13.x
tile.json

tessl/pypi-aiortc

tessl install tessl/pypi-aiortc@1.13.0

Python 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%

task.mdevals/scenario-1/

Real-Time Audio Stream Receiver

Build a real-time audio stream receiver that can accept incoming RTP audio streams from a remote peer, decode the audio, and save it to a file.

Capabilities

Establish peer connection and receive audio

  • Receives remote SDP offer containing audio track and responds with answer @test
  • Handles incoming ICE candidates from remote peer @test

Process received audio stream

  • Receives audio frames from remote peer's audio track @test
  • Saves received audio to output file in WAV format @test

Implementation

@generates

API

import asyncio
from aiortc import RTCPeerConnection, RTCSessionDescription

class AudioReceiver:
    """
    Receives real-time audio from a remote WebRTC peer.
    """

    def __init__(self, output_file: str):
        """
        Initialize the audio receiver.

        Args:
            output_file: Path where received audio will be saved (WAV format)
        """
        pass

    async def receive_offer(self, offer_sdp: str, offer_type: str) -> dict:
        """
        Process an incoming SDP offer from a remote peer and generate an answer.

        Args:
            offer_sdp: The SDP offer string from the remote peer
            offer_type: The type of the offer (typically "offer")

        Returns:
            dict with keys 'sdp' (str) and 'type' (str) containing the answer
        """
        pass

    async def add_ice_candidate(self, candidate: str, sdp_mid: str, sdp_mline_index: int):
        """
        Add an ICE candidate received from the remote peer.

        Args:
            candidate: The ICE candidate string
            sdp_mid: Media stream identification
            sdp_mline_index: Index of the media description in the SDP
        """
        pass

    async def start(self):
        """
        Start receiving and processing audio. Blocks until the connection ends.
        """
        pass

    async def close(self):
        """
        Close the connection and finalize the audio file.
        """
        pass

Dependencies { .dependencies }

aiortc { .dependency }

Provides WebRTC implementation for real-time audio/video communication.

@satisfied-by