\documentclass[beamer,multi]{standalone}
\newcommand\setvoiceover[1]{}
\newcommand\setvoiceovertts[1]{}
\newcommand\setvoiceoverext[1]{}
---PREAMBLE---
\begin{document}
\setlength\fboxsep{0pt}
\pgfmathsetmacro\framerate{---FRAMERATE---}
\pgfmathsetmacro\T{---DURATION---}
\pgfmathsetmacro\N{\T*\framerate}
\begin{standaloneframe}%
\fbox{%
\foreach \n in {---SLICESTART---,...,---SLICESTOP---} {%
\pgfmathsetmacro\progress{(\n-1+---NSTART---)/\N}%
\only<\n> {%
---ANIMATION---%
}%
}%
}%
\end{standaloneframe}%
\end{document}

