emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Audio File in beamer and orgmode
@ 2024-10-02  9:50 luis antunes pena
  2024-10-02 12:43 ` Orm Finnendahl
  0 siblings, 1 reply; 5+ messages in thread
From: luis antunes pena @ 2024-10-02  9:50 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Dear all,

I'm working on a presentation in beamer using
orgmode and couldn´t find information on how to
include an audio file in orgmode to be converted
to beamer and a pdf.

Is there any example that you could share?

Thanks in advance.

Luís

[-- Attachment #2: Type: text/html, Size: 630 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Audio File in beamer and orgmode
  2024-10-02  9:50 Audio File in beamer and orgmode luis antunes pena
@ 2024-10-02 12:43 ` Orm Finnendahl
  2024-10-02 15:07   ` luis antunes pena
  2024-10-02 15:20   ` Leo Butler
  0 siblings, 2 replies; 5+ messages in thread
From: Orm Finnendahl @ 2024-10-02 12:43 UTC (permalink / raw)
  To: luis antunes pena; +Cc: Org mailing list

Hi Luís,

 it doesn't work OOTB in org-mode, but you can always embed LaTex
verbatim in Org files using the #+LATEX: prefix.

My recommendation: Generate a LaTex file from org beamer with some
blind text at a place where you need your link and then check, what
you have to input there in order to get working links to audio files
by directly rendering from the LaTeX file generated by org.

This page might get you there:

https://tex.stackexchange.com/questions/51632/embedding-sound-files-into-beamer-presentation-with-media9

This part on the page:

\includemedia[
  addresource=igottafever.mp3,
  flashvars={
    source=igottafever.mp3
   &autoPlay=true
  }

has to be marked up in org-mode like this to appear in the latex after
export:

#+LATEX: \includemedia[
#+LATEX:   addresource=igottafever.mp3,
#+LATEX:   flashvars={
#+LATEX:     source=igottafever.mp3
#+LATEX:    &autoPlay=true
#+LATEX:   }

Once it works, this could also be put into an elisp function and
invoked on a keystroke prompting for the url and its name. I think you
can also use #+BEGIN_LATEX: and #+END_LATEX: to avoid repeating the
#+LATEX on every line.

--
Orm


Am Mittwoch, den 02. Oktober 2024 um 11:50:10 Uhr (+0200) schrieb luis
antunes pena:
> Dear all,
> 
> I'm working on a presentation in beamer using
> orgmode and couldn´t find information on how to
> include an audio file in orgmode to be converted
> to beamer and a pdf.
> 
> Is there any example that you could share?
> 
> Thanks in advance.
> 
> Luís


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Audio File in beamer and orgmode
  2024-10-02 12:43 ` Orm Finnendahl
@ 2024-10-02 15:07   ` luis antunes pena
  2024-10-02 17:51     ` Orm Finnendahl
  2024-10-02 15:20   ` Leo Butler
  1 sibling, 1 reply; 5+ messages in thread
From: luis antunes pena @ 2024-10-02 15:07 UTC (permalink / raw)
  To: Org mailing list

[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]

Thank you, Orm. Now I got it to work in LaTex.
Next step will be in org-mode.
Best,
Luís
PS: This example works only with Adobe Acrobat,
but not with Preview on OSX.

On 02.10.24 14:43, Orm Finnendahl wrote:
> Hi Luís,
>
>   it doesn't work OOTB in org-mode, but you can always embed LaTex
> verbatim in Org files using the #+LATEX: prefix.
>
> My recommendation: Generate a LaTex file from org beamer with some
> blind text at a place where you need your link and then check, what
> you have to input there in order to get working links to audio files
> by directly rendering from the LaTeX file generated by org.
>
> This page might get you there:
>
> https://tex.stackexchange.com/questions/51632/embedding-sound-files-into-beamer-presentation-with-media9
>
> This part on the page:
>
> \includemedia[
>    addresource=igottafever.mp3,
>    flashvars={
>      source=igottafever.mp3
>     &autoPlay=true
>    }
>
> has to be marked up in org-mode like this to appear in the latex after
> export:
>
> #+LATEX: \includemedia[
> #+LATEX:   addresource=igottafever.mp3,
> #+LATEX:   flashvars={
> #+LATEX:     source=igottafever.mp3
> #+LATEX:    &autoPlay=true
> #+LATEX:   }
>
> Once it works, this could also be put into an elisp function and
> invoked on a keystroke prompting for the url and its name. I think you
> can also use #+BEGIN_LATEX: and #+END_LATEX: to avoid repeating the
> #+LATEX on every line.
>
> --
> Orm
>
>
> Am Mittwoch, den 02. Oktober 2024 um 11:50:10 Uhr (+0200) schrieb luis
> antunes pena:
>> Dear all,
>>
>> I'm working on a presentation in beamer using
>> orgmode and couldn´t find information on how to
>> include an audio file in orgmode to be converted
>> to beamer and a pdf.
>>
>> Is there any example that you could share?
>>
>> Thanks in advance.
>>
>> Luís

--------------------------------------------------
Luís Antunes Pena
http://luisantunespena.eu

[-- Attachment #2: Type: text/html, Size: 2868 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Audio File in beamer and orgmode
  2024-10-02 12:43 ` Orm Finnendahl
  2024-10-02 15:07   ` luis antunes pena
@ 2024-10-02 15:20   ` Leo Butler
  1 sibling, 0 replies; 5+ messages in thread
From: Leo Butler @ 2024-10-02 15:20 UTC (permalink / raw)
  To: luis antunes pena; +Cc: Org mailing list

On Wed, Oct 02 2024, Orm Finnendahl <orm.finnendahl@selma.hfmdk-frankfurt.de> wrote:

> Hi Luís,
>
>  it doesn't work OOTB in org-mode, but you can always embed LaTex
> verbatim in Org files using the #+LATEX: prefix.
>
> My recommendation: Generate a LaTex file from org beamer with some
> blind text at a place where you need your link and then check, what
> you have to input there in order to get working links to audio files
> by directly rendering from the LaTeX file generated by org.
>
> This page might get you there:
>
> https://tex.stackexchange.com/questions/51632/embedding-sound-files-into-beamer-presentation-with-media9
>
> This part on the page:
>
> \includemedia[
>   addresource=igottafever.mp3,
>   flashvars={
>     source=igottafever.mp3
>    &autoPlay=true
>   }
>
> has to be marked up in org-mode like this to appear in the latex after
> export:
>
> #+LATEX: \includemedia[
> #+LATEX:   addresource=igottafever.mp3,
>
> #+LATEX:   flashvars={
> #+LATEX:     source=igottafever.mp3
>
> #+LATEX:    &autoPlay=true
> #+LATEX:   }
>
> Once it works, this could also be put into an elisp function and
> invoked on a keystroke prompting for the url and its name. I think you
> can also use #+BEGIN_LATEX: and #+END_LATEX: to avoid repeating the
> #+LATEX on every line.

You can use `org-link-set-parameters' to set a custom handlers for a link
type.

Here is a simple example:

#+begin_src elisp
(org-link-set-parameters "play" :export #'(lambda (path description backend info)
					    (message "path=%s description=%s backend=%s info=%s" path description backend info)
					    (cl-case backend
					      ((beamer latex)
					       (format "\\href{run:%s}{%s}\n" path description))
					      (t
					       (format "")))))
#+end_src

Then, the link

[[play:vlc --rate 3 --loop --fullscreen unfolding.mp4][unfolding.mp4]]

will be exported as a link in the beamer file that runs that command.

For your purposes, with Orm's example,

#+begin_src elisp
(org-link-set-parameters "mp3emb" :export #'(lambda (path description backend _info)
					    (cl-case backend
					      ((beamer latex)
					       (format
                                               "\\includemedia[addresource=%s,flashvars={source=%s&autoPlay=true}]{\\fbox{%s}}{PLAYER}\n"
                                               path path description))
					      (t
					       (format "")))))
#+end_src

should allow you to use a link like

[[mp3emb:music.mp3][Background noise]]

in your Org file.

Note that you do need to set the PLAYER.

Best,
Leo

>
> --
> Orm
>
>
> Am Mittwoch, den 02. Oktober 2024 um 11:50:10 Uhr (+0200) schrieb luis
> antunes pena:
>> Dear all,
>> 
>> I'm working on a presentation in beamer using
>> orgmode and couldn´t find information on how to
>> include an audio file in orgmode to be converted
>> to beamer and a pdf.
>> 
>> Is there any example that you could share?
>> 
>> Thanks in advance.
>> 
>> Luís
>

-- 
---
Best regards,
Dr Butler

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Audio File in beamer and orgmode
  2024-10-02 15:07   ` luis antunes pena
@ 2024-10-02 17:51     ` Orm Finnendahl
  0 siblings, 0 replies; 5+ messages in thread
From: Orm Finnendahl @ 2024-10-02 17:51 UTC (permalink / raw)
  To: emacs-orgmode

Hi Luís,

 I think it'd be good if you post your solution here once you got it
figured out, so other people can benefit from your time spent.

--
Orm

Am Mittwoch, den 02. Oktober 2024 um 17:07:07 Uhr (+0200) schrieb luis antunes pena:
> Thank you, Orm. Now I got it to work in LaTex.
> Next step will be in org-mode.
> Best,
> Luís
> PS: This example works only with Adobe Acrobat,
> but not with Preview on OSX.
> 
> On 02.10.24 14:43, Orm Finnendahl wrote:
> > Hi Luís,
> > 
> >   it doesn't work OOTB in org-mode, but you can always embed LaTex
> > verbatim in Org files using the #+LATEX: prefix.
> > 
> > My recommendation: Generate a LaTex file from org beamer with some
> > blind text at a place where you need your link and then check, what
> > you have to input there in order to get working links to audio files
> > by directly rendering from the LaTeX file generated by org.
> > 
> > This page might get you there:
> > 
> > https://tex.stackexchange.com/questions/51632/embedding-sound-files-into-beamer-presentation-with-media9
> > 
> > This part on the page:
> > 
> > \includemedia[
> >    addresource=igottafever.mp3,
> >    flashvars={
> >      source=igottafever.mp3
> >     &autoPlay=true
> >    }
> > 
> > has to be marked up in org-mode like this to appear in the latex after
> > export:
> > 
> > #+LATEX: \includemedia[
> > #+LATEX:   addresource=igottafever.mp3,
> > #+LATEX:   flashvars={
> > #+LATEX:     source=igottafever.mp3
> > #+LATEX:    &autoPlay=true
> > #+LATEX:   }
> > 
> > Once it works, this could also be put into an elisp function and
> > invoked on a keystroke prompting for the url and its name. I think you
> > can also use #+BEGIN_LATEX: and #+END_LATEX: to avoid repeating the
> > #+LATEX on every line.
> > 
> > --
> > Orm
> > 
> > 
> > Am Mittwoch, den 02. Oktober 2024 um 11:50:10 Uhr (+0200) schrieb luis
> > antunes pena:
> > > Dear all,
> > > 
> > > I'm working on a presentation in beamer using
> > > orgmode and couldn´t find information on how to
> > > include an audio file in orgmode to be converted
> > > to beamer and a pdf.
> > > 
> > > Is there any example that you could share?
> > > 
> > > Thanks in advance.
> > > 
> > > Luís
> 
> --------------------------------------------------
> Luís Antunes Pena
> http://luisantunespena.eu


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-02 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-02  9:50 Audio File in beamer and orgmode luis antunes pena
2024-10-02 12:43 ` Orm Finnendahl
2024-10-02 15:07   ` luis antunes pena
2024-10-02 17:51     ` Orm Finnendahl
2024-10-02 15:20   ` Leo Butler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).