# How to embed a song in a pdf?

How can I create a document that has a song playing in the back with (La)TeX? Is it even possible?

My hunch is that if you can embed video, there should be a way to embed music... but what is the best way to do it? I guess having a black box playing a song is possible, but something tells me there should be a beTeX way to do this.

The media9 package has support for embedding audio only, as well as video.

An example from the package documentation:

\documentclass{article}
\usepackage{media9}

\begin{document}
\includemedia[
flashvars={
source=http://www.openbsd.org/songs/song49.mp3
&autoPlay=true
},
transparent
]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song}}{APlayer.swf}
\end{document}


The UI for this is a simple button to download the song and play it.

Note: The PDF output will only work in Adobe Reader 9, but no version greater than 9.4.1 on Linux, as per the media9 documentation.

• Nice. Do you know if evince supports it? Mine doesn't. – Sigur Apr 23 '14 at 1:08