On 8/14/2018 5:38 PM, Pablo Rodriguez wrote:
Dear list,
this is sounds-001.tex from the examples:
\definerenderingwindow
[example]
[width=0pt,height=0pt,frame=off]
\setupinteraction[state=start]
\useexternalrendering
[mysound]
[audio/mpeg] % audio/x-mp3
[akkerman.mp3]
[embed]
\definereference [StartSoundTrack] [StartRendering{mysound}]
\definereference [StopSoundTrack] [StopRendering{mysound}]
\definelayer[resources][width=\paperwidth,height=\paperheight]
\setupbackgrounds[page][background=resources]
\starttext
\setlayer[resources]{\placerenderingwindow[example][mysound]}
\startTEXpage
\button{start}[StartSoundTrack]
\button{stop}[StopSoundTrack]
\stopTEXpage
\startTEXpage
\button{start}[StartSoundTrack]
\button{stop}[StopSoundTrack]
\stopTEXpage
\stoptext
I added the option to embed the file. I’m attaching the result.
As I cannot check it myself with Acrobat for Linux (it seems to lack a
player for MP3 files), I asked at the Spanish TeX mailing list whether
they can play the MP3 file embedded in the PDF file.
I have no clue. But these interactive media features in pdf are such a
mess. Embedding a simple sound file or video has become a pain and
changed over time. I think that the modern way is to create a bunch of
useless objects, embed a shockwave (soon obsolete flash) player etc etc
and who knows what in a few years.
While all we want is to embed a sound file (afaik the old easy ways are
obsolete).
One can only use acrobat to check. My most recent version is 10.1 and
i'm not going to subscribe to some lock-in pro version for 20 euro per
month in order to check if code still works. Having the file in the sam
epaths seems to work so maybe something is missing. One problem i
remember is that when one adds too many key/values one suddenly gets
sounds mentioned in side bars and so.
If you need it you can spend some time on deciphering the latest spec
and tell me what is missing.
A MacOS X user (with Acrobat 9.5) told me that the program reports that
the file "akkerman.mp3" is missing. Although the file is indeed
embedded, the /Filespec points to the external file.
Decompressing the PDF file, I see that there are two similar objects:
\nopdfcompression save you that step
8 0 obj
<<
/EF <<
/F 7 0 R
>>
/F (akkerman.mp3)
/Type /Filespec
/UF
(\376\377\000a\000k\000k\000e\000r\000m\000a\000n\000.\000m\000p\0003)
>>
endobj
10 0 obj
<<
/EF 8 0 R
/F (akkerman.mp3)
/Type /Filespec
>>
endobj
This object contains a strange dictionary (an indirect reference to the
same object it contains it?):
13 0 obj
<<
/Type /Annot
/A <<
/AN 13 0 R
/OP 0
/R 12 0 R
/S /Rendition
>>
/Border [ 0 0 0 ]
/P 14 0 R
/Subtype /Screen
/Rect [ 0 14.416 0 14.416 ]
>>
endobj
I mean, the object already exists:
15 0 obj
<<
/AN 13 0 R
/OP 0
/R 12 0 R
/S /Rendition
>>
endobj
Could anyone tell me what I’m doing wrong so that the embedded file
isn’t played?
Many thanks for your help,
Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________