# Embedded audio in to pdf

I once had a very nice setup. I used movie15 to embed mp4 audio files in to a pdf. I used tikz to create a nice wrapper and used an play icon that could be clicked on and the audio item would item up in an external player. This worked in sumatra pdf and acrobat.

Now movie15 is depreciated and just returns junk(errors or text like name ABC@123 or something).

I have tried media9 and can get audio to show up and play in acrobat but not sumatra(due to it using swf).

Is there any way to simply embed a file in a pdf and have a click on an object(image) open that file in an external player?

movie15 worked well, but seeing that it is no longer supported, I don't know if it's worth trying to get to work. The errors I get(which are printed inside the pdf as normal text) are like:

name @MXV@EfAFaIEfJIAfIefjeIJIsjifJIASfJI xyz
width height depth /Subtype /FileAttachment/F 0/T (Myfile.mp4)/Contents (Media File (video/mp4))/AP «/N«»/R«»/D«»»/FS 202 0 Rwidth height depth /Subtype /Screen/Border [0 0 0]/BS «/S/S/W 0»/F 5/T (Myfile.mp4)/Contents (Media File (video/mp4))/P 21 0 R/A 199 0 R/AA 200 0 R/AP

\pdftexversion (fixed by doing \newcommand{\pdftexversion}{200})
\pdfdest
\pdfannot


Any ideas? (Again, used to work fine before trying to update to latest packages, so it almost surely isn't some bug in the code)

• For embedding the audio file as a file attachment and playback in an external app, use one of the dedicated pkgs, such as embedfile, attachfile, attachfile2. – AlexG Dec 21 '16 at 9:27
• @AlexG attachfile and attachfile2 seem to use their own icons rather than allowing one to define their own? Embedfile seems to put all the files at the end of the document? I also get stuff about missing files when I try to use them. – AbstractDissonance Dec 21 '16 at 22:11
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – samcarter_is_at_topanswers.xyz Jan 10 '19 at 19:53

In order to run a media file in an external application the attachfile or attachfile2 packages could be used:

\textattachfile{myvideo.mp4}{\includegraphics[width=1cm]{myi‌​con}}


where myicon is the basename of an image file (file extension removed) to be shown in the link area. Note that this solution requires proper application setting of the operating system for the media file type in question (during viewing time).

The beamer bundle includes the multimedia package that allows sounds to be embedded directly into the PDF. The multimedia package works outside the beamer class

\documentclass{article}
\usepackage{graphicx}
\usepackage[implicit=false]{hyperref}
\usepackage{multimedia}

\begin{document}
\sound[inlinesound]{\includegraphics{example-image}}{1024Tone.wav}
\end{document}


Note that the MWE requires a file called 1024Tone.wav