ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* embedded sounds aren’t played
@ 2018-08-14 15:38 Pablo Rodriguez
  2018-08-14 16:35 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Pablo Rodriguez @ 2018-08-14 15:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

[-- Attachment #2: mediaclip-sound.pdf --]
[-- Type: application/pdf, Size: 54455 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: embedded sounds aren’t played
  2018-08-14 15:38 embedded sounds aren’t played Pablo Rodriguez
@ 2018-08-14 16:35 ` Hans Hagen
  2018-08-15 17:25   ` Pablo Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2018-08-14 16:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

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

* Re: embedded sounds aren’t played
  2018-08-14 16:35 ` Hans Hagen
@ 2018-08-15 17:25   ` Pablo Rodriguez
  2018-08-15 19:34     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Pablo Rodriguez @ 2018-08-15 17:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

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

* Re: embedded sounds aren’t played
  2018-08-15 17:25   ` Pablo Rodriguez
@ 2018-08-15 19:34     ` Hans Hagen
  2018-08-15 20:17       ` Pablo Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2018-08-15 19:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Pablo Rodriguez

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
___________________________________________________________________________________

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

* Re: embedded sounds aren’t played
  2018-08-15 19:34     ` Hans Hagen
@ 2018-08-15 20:17       ` Pablo Rodriguez
  2018-08-15 20:31         ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Pablo Rodriguez @ 2018-08-15 20:17 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

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

* Re: embedded sounds aren’t played
  2018-08-15 20:17       ` Pablo Rodriguez
@ 2018-08-15 20:31         ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2018-08-15 20:31 UTC (permalink / raw)
  To: ntg-context@ntg.nl >> mailing list for ConTeXt users

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
___________________________________________________________________________________

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

end of thread, other threads:[~2018-08-15 20:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 15:38 embedded sounds aren’t played Pablo Rodriguez
2018-08-14 16:35 ` Hans Hagen
2018-08-15 17:25   ` Pablo Rodriguez
2018-08-15 19:34     ` Hans Hagen
2018-08-15 20:17       ` Pablo Rodriguez
2018-08-15 20:31         ` Hans Hagen

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 NNTP newsgroup(s).