From 436a9c4219c234f07f6ae7fe1a37714ac764a492 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 2 Aug 2010 11:49:14 +0200 Subject: Add details about audio packet transmission --- airtunes2.rst | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/airtunes2.rst b/airtunes2.rst index 599e0ae..29779ca 100644 --- a/airtunes2.rst +++ b/airtunes2.rst @@ -61,6 +61,27 @@ Connect #. Prepare RTP connection for audio packets +Transmitting Audio +~~~~~~~~~~~~~~~~~~ + +The audio data is encapsulated in an RTP packet (see RFC3550 Section 5.1) + +#. Bytes 0-1 of the RTP Header are 0x80, 0x60 +#. Bytes 2-3 store the current sequence number (whose initial value was set + in the RECORD RTSP request) +#. Bytes 4-7 store the current RTP timestamp (initial value was transmitted + to the Airtunes device in the RECORD RTSP request) +#. Bytes 8-11 store the SSRC (random number which will be the same in all + audio packets, see RFC3550 Section 5.1 for more details) (TODO: is the + SSRC the same as the RTSP client session ID ?) +#. Starting at byte 12 comes the audio data (see `Packetizing audio`_ for + its format) +#. Send this RTP packet as UDP on the audio data port +#. Increase sequence number by one for next audio packet +#. Increase timestamp by number of frames in this audio packet + + + Disconnect ~~~~~~~~~~ @@ -520,11 +541,6 @@ Packetizing audio the rest stays unencrypted) #. Copy audio header to buffer #. Append encrypted audio data to buffer - -#. Set bytes 2-4 to sequence number in big endian -#. Set bytes 4-8 to timestamp in big endian -#. Increase sequence number by one for next packet -#. Increase timestamp by number of frames in this packet Metadata -- cgit v1.2.3-59-g8ed1b