% LICENSE: see LICENCE

\section{ODR-DabMux ETI file formats}
\label{etiformat}
ODR-DabMux supports three output formats for the ETI stream, that have been described on the mmbTools forum
website.\footnote{\url{http://mmbtools.crc.ca/component/option,com\_fireboard/Itemid,55/func,view/id,4/catid,13/\#28}}

The three formats are called \emph{framed}, \emph{streamed} and \emph{raw}.

The \emph{framed} format is used for saving a finite ETI stream into a file. Each frame does not contain any padding, and the
format can be described as follows:
\begin{lstlisting}
uint32_t nbFrames
// for each frame
  uint16_t frameSize
  uint8_t data[frameSize]
\end{lstlisting}

When streaming data, in which case the number of frames is not known in advance, the \emph{streamed} format can be used.
This format is identical to the first one except for the missing \texttt{nbFrames}.
\begin{lstlisting}
// for each frame
  uint16_t frameSize
  uint8_t data[frameSize]
\end{lstlisting}

The \emph{raw} format corresponds to ETI(NI), where each frame has a constant size of 6144 Bytes. The padding in this
case is necessary.
\begin{lstlisting}
// for each frame
  uint8_t data[6144]
\end{lstlisting}

In order to select the format, the following syntax for the \texttt{-O} option is used:
\texttt{-O file://filename?type=format}, where \texttt{format} is one of \verb+framed+, \verb+streamed+ or
\verb+raw+.


\section{Additional EDI TAGs used}
ODR defined and uses two additional EDI TAGs, whose content is described here.

ODR-AudioEnc inserts audio level metadata into the ``ODRa'' TAG. The TAG item is in the following format:
\begin{lstlisting}
  TAG Name="ODRa" [4 bytes]
  Length=4 [4 bytes]
  Left Audio Level [signed 16-bit integer]
  Right Audio Level [signed 16-bit integer]
\end{lstlisting}


The second EDI TAG ``ODRv'' contains version and uptime information for the EDI source.
\begin{lstlisting}
  TAG Name="ODRv" [4 bytes]
  Length=N+4 [4 bytes]
  Version [String of N bytes, UTF-8 encoded, not zero terminated]
  Uptime [unsigned 32-bit integer representing number of seconds since program start]
\end{lstlisting}


\section{Bibliography}
\bibliographystyle{acm}
\bibliography{dab}

