[Tex/LaTex] Embedding sound files into beamer presentation with media9

beamerinline()media9

I'm trying to embed a sound file inline into a beamer so i don't need to carry the sound file around with the pdf.

Currently I place sound files into my beamer with the multimedia package and this command:

\movie[inlinesound]{\fbox{Play}}{igottafever.wav}

For some reason the \sound command gives scrambled static. But the inlinesound option apparently doesn't work with \movie. QUESTION 1: Is there some inline option for \movie?

All the examples I see with media9 are of audio streams from online. QUESTION 2: How do I place a local file into a pdf with media9?
This is not working:

\includemedia[flashvars={source=igottafever.wav}]{\fbox{Play}}{APlayer.swf

Throws an Error #2032: Stream Error. URL: file://PDFMedia022077/invalid in Acrobat X

Best Answer

The only sound file format that can be played back is mp3. To embed local resource files (a sound file in the present case) into the PDF, use option addresource and adjust the source FlashVar accordingly.

Embedded sound file example:

\documentclass{beamer}
\usepackage{media9}
%\usepackage[english]{babel} % no longer required as of media9-20120412 (v0.4)

\begin{document}

\begin{frame}{Sound example}
\includemedia[
  addresource=igottafever.mp3,
  flashvars={
    source=igottafever.mp3
   &autoPlay=true
  }
]{\fbox{Play}}{APlayer.swf}
\end{frame}

\end{document}