Protocols
AirPlay and AirTunes can work over a
local network (LAN), through either
Wi-Fi or
Ethernet, or (since 2017) directly to each other using
Wi-Fi Direct, allowing devices to connect without a central LAN.
[22] This method of
peer-to-peer connecting is now preferred by AirPlay, but Apple notes that the protocol establishes a connection "using the method that’s the most responsive".
[2]
The AirTunes part of the AirPlay protocol stack uses
UDP for streaming audio and is based on the
Real Time Streaming Protocol.
[23] The streams are transcoded using the
Apple Lossless codec with 44100 Hz and 2 channels symmetrically encrypted with
AES, requiring the receiver to have access to the appropriate key to decrypt the streams.
[24] The stream is buffered for approximately 2 seconds before playback begins, resulting in a small delay before audio is output after starting an AirPlay stream.
[25]
The protocol supports metadata packets that determine the final output volume on the receiving end. This makes it possible to always send audio data unprocessed at its original full volume, preventing sound quality deterioration due to reduction in
bit depth and thus sound quality which would otherwise occur if changes in volume were made to the source stream before transmitting. It also makes possible the streaming of one source to multiple targets each with its own volume control, and for volume adjustments to be applied instantly, instead of being delayed by the 2 second buffer period. The AirPort Express' streaming media capabilities use Apple's
Remote Audio Output Protocol (RAOP), a proprietary variant of
RTSP/
RTP. Using
WDS-bridging,
[26] the AirPort Express can allow AirPlay functionality (as well as Internet access,
file and
print sharing, etc.) across a larger distance in a mixed environment of wired and up to 10 wireless clients.