ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* embedded sounds
@ 2018-10-09 17:19 Pablo Rodriguez
  2018-10-09 17:49 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Rodriguez @ 2018-10-09 17:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

[-- Attachment #2: embedded-mp3-sound.pdf --]
[-- Type: application/pdf, Size: 57381 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] 4+ messages in thread

* Re: embedded sounds
  2018-10-09 17:19 embedded sounds Pablo Rodriguez
@ 2018-10-09 17:49 ` Hans Hagen
  2018-10-09 18:24   ` Alan Braslau
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2018-10-09 17:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Pablo Rodriguez

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
___________________________________________________________________________________

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

* Re: embedded sounds
  2018-10-09 17:49 ` Hans Hagen
@ 2018-10-09 18:24   ` Alan Braslau
  2018-10-10 15:17     ` Pablo Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Braslau @ 2018-10-09 18:24 UTC (permalink / raw)
  To: Pablo Rodriguez; +Cc: mailing list for ConTeXt users

On Tue, 9 Oct 2018 19:49:44 +0200
Hans Hagen <j.hagen@xs4all.nl> 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
___________________________________________________________________________________

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

* Re: embedded sounds
  2018-10-09 18:24   ` Alan Braslau
@ 2018-10-10 15:17     ` Pablo Rodriguez
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Rodriguez @ 2018-10-10 15:17 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

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

end of thread, other threads:[~2018-10-10 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 17:19 embedded sounds Pablo Rodriguez
2018-10-09 17:49 ` Hans Hagen
2018-10-09 18:24   ` Alan Braslau
2018-10-10 15:17     ` Pablo Rodriguez

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).