GeneralEmbedded Sound File

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Embedded Sound File

Post by Pierrotdu18 »

Hello everybody,

I'm trying to embed a sound file (.mp3) with media9 package, but it seems that my code has errors, as LaTeX does not want to load it.

Here's my code:

Code: Select all

\includemedia[
  height=5em,
  width=30em,
  addresource=son_con.mp3,
  flashvars={source=son_con.mp3 & autoPlay=true}
]{{\fbox{Exemple de son consonant}}}{APlayer.swf}
But, I'm told that there is an error. :(

And if y remove the addresource parameter, the PDF is created, but there is the error #2032 when I try to play the sound (it is a 3MB sound).

Thanks a lot to the ones who will bring me a help,
Sorry for my bad English, I'm French ;)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Re: Embedded Sound File

Post by Pierrotdu18 »

Hmm... If someone could try to help me before Wednesday, it would be very cool, as I have to send my document the day after..... :|
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Embedded Sound File

Post by hugovdberg »

Could you please post a Infominimal working example so we have a better idea of your setup, code snippets that can't be compiled as they stand don't invite to help you quickly.
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Embedded Sound File

Post by Pierrotdu18 »

Sorry, here is one :

Code: Select all

\documentclass[a4paper, 12pt, fleqn]{report}
\usepackage{media9}
\usepackage[utf8]{inputenc}
\begin{document}
\section{Partie 1}

Ce qui rend la musique belle, dans chaque morceau, c'est le choix des accords qui viendront accompagner la mélodie. Certains accords sont beaux à l’oreille, sont joyeux, ou tristes, ce sont les accords ``consonants", comme celui ci :

\includemedia[height=5em, width=30em, addresource=son_con.mp3, flashvars={source=son_con.mp3 & autoPlay=true}]{{\fbox{Exemple de son consonant}}}{APlayer.swf}

Nous nous concentrerons surtout sur les ``intervalles", c’est à dire des accords de deux notes seulement, et nous verrons comment ceux ci peuvent nous paraître harmonieux, consonants, ou au contraire rugueux, dissonants.
\end{document}
I can't upload my sound file cause it weights 3mb, but this file works well, my code doesn't work even with other sound files...
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Re: Embedded Sound File

Post by Pierrotdu18 »

Hum... My file was just too big, cold case ;)
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Re: Embedded Sound File

Post by hugovdberg »

Hmm, when I try to compile your code it compiles just fine (I just copied a mp3 of my own to son_con.mp3 to test with). I'm not able to test the play function as I'm on a Linux computer without Adobe Reader, but the file size seems reasonable to me.

Could you give the exact error message?
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

Re: Embedded Sound File

Post by Pierrotdu18 »

Hum...
Hmm ... Sorry, I think I was not clear, in fact, my problem is solved, it was just that the file size was too large ;)
I just packed it a little with Audacity, and everything now works :)

Edit : It seems that the maximum size of a sound file is 3mb... As my 3mb file didn't work, and my 1.6mb new file works...
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Re: Embedded Sound File

Post by hugovdberg »

That's interesting, I included a 10MB mp3 without problems, even with pdflatex. But if it works fine now then just go with it ;)
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Post Reply