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-3/

Audio Level Analyzer

Build a tool that analyzes audio samples and reports their loudness levels in decibels relative to overload (dBov), a standard measurement used in digital audio and telecommunications systems.

Requirements

Implement a function that processes audio samples and computes their audio level in dBov:

  1. Accept a list of audio sample values (floating-point numbers, typically normalized between -1.0 and 1.0)
  2. Calculate the Root Mean Square (RMS) value of the samples
  3. Convert the RMS to decibels relative to overload (dBov), where 0 dBov represents the maximum possible signal level

The function must handle edge cases properly, particularly silent audio where RMS is zero (return -127.0 dBov as the minimum measurable level).

Implementation

@generates

API

def calculate_audio_level(samples: list[float]) -> float:
    """
    Calculate the audio level in dBov from audio samples.

    Args:
        samples: List of audio sample values (floating-point, typically -1.0 to 1.0)

    Returns:
        Audio level in dBov (decibels relative to overload).
        Returns -127.0 for silent audio (RMS of 0).
        Range: -127.0 to 0.0 dBov
    """
    pass

Test Cases

  • Given samples [0.5, -0.5, 0.5, -0.5], returns approximately -6.02 dBov @test
  • Given samples with all zeros [0.0, 0.0, 0.0, 0.0], returns -127.0 dBov (minimum level) @test
  • Given samples [1.0, 1.0, 1.0, 1.0], returns 0.0 dBov (maximum level) @test
  • Given samples [0.1, -0.1, 0.2, -0.2], returns approximately -20.0 dBov @test

Dependencies { .dependencies }

aiortc { .dependency }

Provides WebRTC utilities including audio processing functions.

@satisfied-by