Re: [NTG-context] embedded sounds
On 10/9/18 8:24 PM, Alan Braslau wrote: > On Tue, 9 Oct 2018 19:49:44 +0200 Hans Hagen wrote: > [...] > Embedded media is an illness inherited from PowerPointers. In my > experience as a seminar presentation organizer, this messes-up 9 > times out of 10 (unless the presenter is using his or her own laptop, > and even then they cannot get it connected to the projector maybe 20% > of the time...). Things are getting a bit better now on the > presentation front, however. (PowerPointers still get funny font > stuff from time to time). My case is rather the opposite. I want to add the sound, so that the presentation is really played: http://www.free-culture.tk/. > Why not, rather, depend on a link opening an external file, > distributed with the pdf, letting the system figure out how this is > to be done? In my experience this works more generally. The method mentioned above can only work with a script that “plays” the presentation. Pablo -- http://www.ousia.tk ___ 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 ___
Re: [NTG-context] embedded sounds
On Tue, 9 Oct 2018 19:49:44 +0200 Hans Hagen wrote: > media in pdf are sort of braindead and it's hard to get something that > doesn't have side effects (attachment vs external vs ...) .. when i > can't hear sound with internal files (no matter how we wrap it i cannot > really test something) ... (it is tempting to just remove the code but > as part of working on the interaction manual i keep it for now) > > the flash dependent media are even worse ... it is supported (as usual) > but not future proof > > (it baffles me that the original simple movie and sound annotations are > sort of gone: they delegated the rendering so no pain for acrobat and no > gain in obsoleting them) Embedded media is an illness inherited from PowerPointers. In my experience as a seminar presentation organizer, this messes-up 9 times out of 10 (unless the presenter is using his or her own laptop, and even then they cannot get it connected to the projector maybe 20% of the time...). Things are getting a bit better now on the presentation front, however. (PowerPointers still get funny font stuff from time to time). Why not, rather, depend on a link opening an external file, distributed with the pdf, letting the system figure out how this is to be done? In my experience this works more generally. Alan ___ 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 ___
Re: [NTG-context] embedded sounds
On 10/9/2018 7:19 PM, Pablo Rodriguez wrote: Hi Hans, this is a lighter version from sound-001.tex from your test samples: media in pdf are sort of braindead and it's hard to get something that doesn't have side effects (attachment vs external vs ...) .. when i can't hear sound with internal files (no matter how we wrap it i cannot really test something) ... (it is tempting to just remove the code but as part of working on the interaction manual i keep it for now) the flash dependent media are even worse ... it is supported (as usual) but not future proof (it baffles me that the original simple movie and sound annotations are sort of gone: they delegated the rendering so no pain for acrobat and no gain in obsoleting them) \definerenderingwindow [example] [width=0pt,height=0pt,frame=off] \setupinteraction[state=start] \useexternalrendering [mysound] [audio/x-mp3] % audio/x-mp3 [sound.mp3] %~ [embed] \definereference [StartSoundTrack] [StartRendering{mysound}] \definereference [StopSoundTrack] [StopRendering{mysound}] \definelayer[resources][width=\paperwidth,height=\paperheight] \setupbackgrounds[page][background=resources] \setupbodyfont[100pt] \starttext\bf\ss \setlayer[resources]{\placerenderingwindow[example][mysound]} \startTEXpage \button{start}[StartSoundTrack] \button{stop}[StopSoundTrack] \stopTEXpage \stoptext As reported before (https://mailman.ntg.nl/pipermail/ntg-context/2018/092327.html), sound is played fine when not embedded. But it won’t play embedded files. Without embedded sound, the relevant /Filespec reads: 7 0 obj << /F (sound.mp3) /Type /Filespec >> endobj With an embedded sound, /Filespec and /EmbeddedFile read: 7 0 obj << /Subtype /audio#2Fx-mp3 /Type /EmbeddedFile /Length 49006 >> stream endstream endobj 8 0 obj << /EF << /F 7 0 R >> /F (sound.mp3) /Type /Filespec /UF (\376\377\000s\000o\000u\000n\000d\000.\000m\000p\0003) >> endobj 10 0 obj << /EF 8 0 R /F (sound.mp3) /Type /Filespec >> endobj I don’t know why there are two /Filespec objects, since they are duplicated. In any case, the value for the /EF entry has to be a dictionary that points to the /EmbeddedFile (such as in object 8). I’m afraid that the code that generates the second /Filespec object (object 10 in the code above) is wrong. I attach a modified file fixing the issue from the PDF document generated by ConTeXt. I hope this help to fix the issue. 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 ___
[NTG-context] embedded sounds
Hi Hans, this is a lighter version from sound-001.tex from your test samples: \definerenderingwindow [example] [width=0pt,height=0pt,frame=off] \setupinteraction[state=start] \useexternalrendering [mysound] [audio/x-mp3] % audio/x-mp3 [sound.mp3] %~ [embed] \definereference [StartSoundTrack] [StartRendering{mysound}] \definereference [StopSoundTrack] [StopRendering{mysound}] \definelayer[resources][width=\paperwidth,height=\paperheight] \setupbackgrounds[page][background=resources] \setupbodyfont[100pt] \starttext\bf\ss \setlayer[resources]{\placerenderingwindow[example][mysound]} \startTEXpage \button{start}[StartSoundTrack] \button{stop}[StopSoundTrack] \stopTEXpage \stoptext As reported before (https://mailman.ntg.nl/pipermail/ntg-context/2018/092327.html), sound is played fine when not embedded. But it won’t play embedded files. Without embedded sound, the relevant /Filespec reads: 7 0 obj << /F (sound.mp3) /Type /Filespec >> endobj With an embedded sound, /Filespec and /EmbeddedFile read: 7 0 obj << /Subtype /audio#2Fx-mp3 /Type /EmbeddedFile /Length 49006 >> stream endstream endobj 8 0 obj << /EF << /F 7 0 R >> /F (sound.mp3) /Type /Filespec /UF (\376\377\000s\000o\000u\000n\000d\000.\000m\000p\0003) >> endobj 10 0 obj << /EF 8 0 R /F (sound.mp3) /Type /Filespec >> endobj I don’t know why there are two /Filespec objects, since they are duplicated. In any case, the value for the /EF entry has to be a dictionary that points to the /EmbeddedFile (such as in object 8). I’m afraid that the code that generates the second /Filespec object (object 10 in the code above) is wrong. I attach a modified file fixing the issue from the PDF document generated by ConTeXt. I hope this help to fix the issue. Many thanks for your help, Pablo -- http://www.ousia.tk embedded-mp3-sound.pdf Description: Adobe PDF document ___ 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 ___
Re: [NTG-context] embedded sounds aren’t played
On 8/15/2018 10:17 PM, Pablo Rodriguez wrote: On 08/15/2018 09:34 PM, Hans Hagen wrote: On 8/15/2018 7:25 PM, Pablo Rodriguez wrote: If you need it you can spend some time on deciphering the latest spec and tell me what is missing. I need it. I already spent some time trying to decipher what was wrong. But I failed. It seems that I need to investigate further. one needs a minimal example that works without side effects and not using flash with all crap objects/keys that are not needed removed I hope to be able to provide the document (or the suggestion) in the near future ). BTW, I’m afraid that with the changes to lpdf-wid.lua, not even what worked before is working now. But I’m going to investigate this and see what I can get to get the situation improved. it works here with a mp3 filew in the current path - 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 ___
Re: [NTG-context] embedded sounds aren’t played
On 08/15/2018 09:34 PM, Hans Hagen wrote: > On 8/15/2018 7:25 PM, Pablo Rodriguez wrote: >>> If you need it you can spend some time on deciphering the latest spec >>> and tell me what is missing. >> >> I need it. I already spent some time trying to decipher what was wrong. >> But I failed. It seems that I need to investigate further. > > one needs a minimal example that works without side effects and not > using flash with all crap objects/keys that are not needed removed I hope to be able to provide the document (or the suggestion) in the near future ). BTW, I’m afraid that with the changes to lpdf-wid.lua, not even what worked before is working now. But I’m going to investigate this and see what I can get to get the situation improved. Pablo -- http://www.ousia.tk ___ 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 ___
Re: [NTG-context] embedded sounds aren’t played
On 8/15/2018 7:25 PM, Pablo Rodriguez wrote: On 08/14/2018 06:35 PM, Hans Hagen wrote: On 8/14/2018 5:38 PM, Pablo Rodriguez wrote: Dear list, this is sounds-001.tex from the examples: [...] 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 know. RichMedia is even an extension to the PDF spec 1.7 (https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/adobe_supplement_iso32000.pdf). 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). As long as it isn’t deprecated, I would like to use MediaClip (to be able to handle it with JS code). 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. http://www.davidgilmour.com/freedom/ uses a similar approach (although no MediaClip, but RichMedia instead). And they work fine with latest Acrobat Reader. Having the file in the same paths seems to work so maybe something is missing. This is also my impression, but I still haven’t found what I’m looking for (https://www.youtube.com/watch?v=e3-5YC_oHjE). One problem i remember is that when one adds too many key/values one suddenly gets sounds mentioned in side bars and so. I only want to embed a single audio file per PDF document. If you need it you can spend some time on deciphering the latest spec and tell me what is missing. I need it. I already spent some time trying to decipher what was wrong. But I failed. It seems that I need to investigate further. one needs a minimal example that works without side effects and not using flash with all crap objects/keys that are not needed removed Hans -- - 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 ___
Re: [NTG-context] embedded sounds aren’t played
On 08/14/2018 06:35 PM, Hans Hagen wrote: > On 8/14/2018 5:38 PM, Pablo Rodriguez wrote: >> Dear list, >> >> this is sounds-001.tex from the examples: >> [...] >> 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 know. RichMedia is even an extension to the PDF spec 1.7 (https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/adobe_supplement_iso32000.pdf). > 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). As long as it isn’t deprecated, I would like to use MediaClip (to be able to handle it with JS code). > 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. http://www.davidgilmour.com/freedom/ uses a similar approach (although no MediaClip, but RichMedia instead). And they work fine with latest Acrobat Reader. > Having the file in the same paths seems to work so maybe something is > missing. This is also my impression, but I still haven’t found what I’m looking for (https://www.youtube.com/watch?v=e3-5YC_oHjE). > One problem i remember is that when one adds too many key/values one > suddenly gets sounds mentioned in side bars and so. I only want to embed a single audio file per PDF document. > If you need it you can spend some time on deciphering the latest spec > and tell me what is missing. I need it. I already spent some time trying to decipher what was wrong. But I failed. It seems that I need to investigate further. >> Decompressing the PDF file, I see that there are two similar objects: > > \nopdfcompression save you that step I know, but the output from "mutool clean -d" is more readable to me. And it comes also handy to add in text messages. Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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 ___
Re: [NTG-context] embedded sounds aren’t played
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 ___
[NTG-context] embedded sounds aren’t played
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. 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: 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 -- http://www.ousia.tk mediaclip-sound.pdf Description: Adobe PDF document ___ 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 ___