VibeBuilders.ai Logo
VibeBuilders.ai

Decoding

Explore resources related to decoding to help implement AI solutions for your business.

aiortc
github
LLM Vibe Score0.507
Human Vibe Score0.11415188209660238
aiortcMar 28, 2025

aiortc

.. image:: docs/_static/aiortc.svg :width: 120px :alt: aiortc .. image:: https://img.shields.io/pypi/l/aiortc.svg :target: https://pypi.python.org/pypi/aiortc :alt: License .. image:: https://img.shields.io/pypi/v/aiortc.svg :target: https://pypi.python.org/pypi/aiortc :alt: Version .. image:: https://img.shields.io/pypi/pyversions/aiortc.svg :target: https://pypi.python.org/pypi/aiortc :alt: Python versions .. image:: https://github.com/aiortc/aiortc/workflows/tests/badge.svg :target: https://github.com/aiortc/aiortc/actions :alt: Tests .. image:: https://img.shields.io/codecov/c/github/aiortc/aiortc.svg :target: https://codecov.io/gh/aiortc/aiortc :alt: Coverage .. image:: https://readthedocs.org/projects/aiortc/badge/?version=latest :target: https://aiortc.readthedocs.io/ :alt: Documentation What is `aiortc? aiortc is a library for Web Real-Time Communication (WebRTC)_ and Object Real-Time Communication (ORTC)_ in Python. It is built on top of asyncio, Python's standard asynchronous I/O framework. The API closely follows its Javascript counterpart while using pythonic constructs: promises are replaced by coroutines events are emitted using pyee.EventEmitter To learn more about aiortc please read the documentation_. .. _Web Real-Time Communication (WebRTC): https://webrtc.org/ .. _Object Real-Time Communication (ORTC): https://ortc.org/ .. _read the documentation: https://aiortc.readthedocs.io/en/latest/ Why should I use aiortc? The main WebRTC and ORTC implementations are either built into web browsers, or come in the form of native code. While they are extensively battle tested, their internals are complex and they do not provide Python bindings. Furthermore they are tightly coupled to a media stack, making it hard to plug in audio or video processing algorithms. In contrast, the aiortc implementation is fairly simple and readable. As such it is a good starting point for programmers wishing to understand how WebRTC works or tinker with its internals. It is also easy to create innovative products by leveraging the extensive modules available in the Python ecosystem. For instance you can build a full server handling both signaling and data channels or apply computer vision algorithms to video frames using OpenCV. Furthermore, a lot of effort has gone into writing an extensive test suite for the aiortc code to ensure best-in-class code quality. Implementation status aiortc allows you to exchange audio, video and data channels and interoperability is regularly tested against both Chrome and Firefox. Here are some of its features: SDP generation / parsing Interactive Connectivity Establishment, with half-trickle and mDNS support DTLS key and certificate generation DTLS handshake, encryption / decryption (for SCTP) SRTP keying, encryption and decryption for RTP and RTCP Pure Python SCTP implementation Data Channels Sending and receiving audio (Opus / PCMU / PCMA) Sending and receiving video (VP8 / H.264) Bundling audio / video / data channels RTCP reports, including NACK / PLI to recover from packet loss Installing The easiest way to install aiortc is to run: .. code:: bash pip install aiortc Building from source If there are no wheels for your system or if you wish to build aiortc from source you will need a couple of libraries installed on your system: Opus for audio encoding / decoding LibVPX for video encoding / decoding Linux ..... On Debian/Ubuntu run: .. code:: bash apt install libopus-dev libvpx-dev OS X .... On OS X run: .. code:: bash brew install opus libvpx License aiortc is released under the BSD license`_. .. _BSD license: https://aiortc.readthedocs.io/en/latest/license.html

airplay2-receiver
github
LLM Vibe Score0.498
Human Vibe Score0.0426074723730768
openairplayMar 27, 2025

airplay2-receiver

Experimental Somewhat comprehensive python implementation of AP2 receiver using some multi-room features. For now it implements: HomeKit transient pairing (SRP/Curve25519/ChaCha20-Poly1305) - bit flag 48 HomeKit non-transient pairing Some refinements for HomeKit interaction (e.g. managed/active flags) Persist device name and some HomeKit properties across restarts (just use the -m flag again to set the device name anew) FairPlay (v3) authentication and decryption of AES keys - the first and only Python implementation. Credit to @systemcrash for implementation. Receiving of both REALTIME and BUFFERED Airplay2 audio streams Airplay2 Service publication Decoding of all Airplay2 supported CODECs: ALAC, AAC, OPUS, PCM. Ref: here and here Output latency compensation for sync with other Airplay receivers ANNOUNCE and RSA AES for unbuffered streaming from iTunes/Windows Spotify (via AirPlay2) and other live media streams with AES keys. RTCP RFC2198 RTP Redundancy handling (basic); enable bit flag 61 streamConnections; enable bit flag 59 For now it does not implement: FairPlay v2 Accurate audio sync (with help of PTP and/or NTP) It may never implement: MFi Authentication (requires MFi hardware module) This code is experimental, yet fully functional. It can act as a real receiver but does not implement all airplay protocols and related pairing/authentication methods. Next steps: PTP (Precision Time Protocol) Remove all os specific code (Soft Volume management) Sender (branch-sender) - Implementation Raspbian package DACP/(+MRP?) Support FairPlay v2 Support Multiple Connections Since multithreading is now enabled, this allows multiple concurrent connections. There are no safeguards built to prevent you playing multiple streams. Python multiprocessing makes this "DJ" mode a possibility but makes stream management and session management (global state data) nigh impossible. So threading is the right approach in the receiver. HomeKit and other AP senders can now connect concurrently to the receiver and perform operations. This opens the path to Remote Control functionality. mDNS/ZeroConf If you encounter strange errors like NonUniqueNameException, or Address already in use, and you run on macOS, you may have noticed that macOS and this app both try to send updates. Here is a possible workaround. Raspberry Pi 4 Install docker and then build the image: To run the receiver: Default network device is wlan0, you can change this with AP2IFACE env variable: Docker Compose Example Docker Compose Debian macOS Catalina To run the receiver please use Python 3 and do the following: Run the following commands Note: in recent macOS versions (e.g. Ventura), you must disable AirPlay Receiver: System Settings -> AirDrop & Handoff -> AirPlay Receiver: disable. Windows To run the receiver please use Python 3 and do the following: Run the following commands the AirPlay 2 receiver is announced as myap2. Tested on Python 3.7.5 / macOS 10.15.2 with iPhone X 13.3 and Raspberry Pi 4 Protocol notes https://emanuelecozzi.net/docs/airplay2