Javascript doesn't play() embedded sound

This is a question about the PDF specification regarding how to use the javascript API
to play a sound object.
Specifically, why in my basic example is the javascript able to see the sound,
but can't play() it?
I have a test PDF illustrating my problem at
http://www.affexion.net/test/PDF/test-scriptsound.pdf
This is a stripped down example.
The sound is referenced from a simple annotation
on the left. Double-clicking it plays the sound as expected.
On the right is a button which when activated is supposed to
execute a javascript.
<< /S /JavaScript /JS ( console.show(); try {this.sounds[0].play(); } catch(e) { console.println(e.toString()); } console.println(this.sounds[0].name); ) >>
I see the console open up, and I see it print the name of the sound "mySound",
but I don't get the sound played.
Do I need to do something in my javascript before I call this.sounds[0].play?
Is there some other mistake in the way I have the sound object embedded and referenced?
Thanks very much for any help.

In followup, I have been able to accomplish what I wanted:
use an embedded javascript to play an embedded sound
For future readers, my example is (temporarily) at:
http://www.affexion.net/test/PDF/sound-by-script.pddf
How I did it:
interaction of 2 components, the script and the (named) sound
The script object looks like:
<< /S /JavaScript
/JS ( console.show\(\); var s=this.getSound\("mySound"\); s.play\(\); )
>>
The named sound "mySound"
The catalog needs an entry pointing to a name dictionary, like:
1 0 obj << /Type /Catalog /Names XX 0 R >> endobj
The name dictionary has an entry /Sound like
XX 0 obj << /Sound XY 0 R >> endobj
Then the actual name mapping:
XY 0 obj << /Names [ (0xFEFFmySound) XZ 0 R ] >> endobj
With the sound object at:
XZ 0 obj << /Type /Sound /Length NNNNN >> stream...endstream endobj
Key point: the string object (0xFEFFmySound) needs to be unicode-16 encoded
with the first 2 bytes being FEFF.
That was a real pitfall for me.
Now that whole setup actually works.
Sadly, though - I looked all through the PDF specification and
in section 7.7.4 Name Dictionary, I don't see any Sound key.
If anyone could explain how that sequence of Name dictionary to
sound name is described in the specification, I'd appreciate it.

Similar Messages

  • Firefox doesn't play embedded swf

    I've looked on many forums, including Firefox, with no real answer. Running Firefox 4. It just doesn't play embedded SWF. My Adobe Flashplayer is up to date, so is the plugin. The page displays properly. But the area that should be displaying a movie is just represented by a tiny square. No error message appears. The same page doesn't show the movie in IE9 either.
    Now from looking at the page information, it just requires Flashplayer 6 and above for the SWF area. I do have Flashplayer 10. The plugin says Shockwave Flash player 10 is up to date. Many other pages with different types of embedded movies play properly.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Also check that you aren't blocking cookies.
    *https://support.mozilla.org/kb/Cookies
    *http://kb.mozillazine.org/Cookies
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Note that a reset imports cookies, so isn't really suited if cookie issues are a possible cause, unless you clear the cookies.

  • Playing embedded sound in a windows office doc on a mac

    Does anyone know if it is possible to play embedded sounds created in word docs on a windows machine on the Mac. Office for Mac does not work. The file seems to be looking for the windows recorder. Does anyone have any ideas for a workaround?
    Thanks in advance for any help.
    Dave

    No response to this So I am marking it answered just to clean up a bit

  • Mail doesn't play any sound with new Gmail emails

    I just signed for a Gmail account but I see it works in a someway different manner from the other email accounts I have. I noticed that Mail shows me a new incoming email almost immediately since I click send from another account, that's a good thing, but unfortunately it doesn't play any sound, like instead it does when I receive emails on the other accounts.
    any suggestions?

    I have noticed with 10.6.x Mail doesn't make sounds when receiving/sending Mail when you first launch it. However if I leave it open (just minimize it) and let it run and Mail goes get new email sound suddenly makes the sounds. I am still trying to figure out why it is happening (on both of my Macs). If you get any idea please share it because I would like to know also.

  • What's the wave's number of iPhone 4S speakers? I need to know what's the number because my phone doesn't play any sounds, and I kind of knew what's the problem and sulotion!

    What's the wave's number of iPhone 4S speakers? I need to know what's the number because my phone doesn't play any sounds, and I kind of knew what's the problem and solution!
    What I mean by wave is like radio channels' waves! Ex. 104.1

    Your statement makes no sense.
    Have you tried basic troubleshooting from the User's Guide to rule out some setting in the device preventing the speaker from working?
    Is the mute switch on?
    Do other sounds work?
    Does it produce sound with headphones plugged in?

  • MacBook Doesn't Play Startup Sound

    Hey guys, for some reason, my Mac doesn't play a startup sound when ever its booting up and the volume is on max. Any ideas as to what might cause this?
    I'm running Mac OS X 10.7.3 (Lion)

    Had this same thing after the 10.7.3 update.
    Try turning the computer off for a time, 10 minutes to whatever number of hours.
    Then when you turn it back on hold down the Option key and when the boot menu screen come up select your Macintosh HD to boot from. Once booted to the OS go into Sys Pref, Start Up Disk and select the Macintosh HD and Restart.
    Also I have noticed that the startup, Boot POST (Power On Self Test) sound is of a lower volume then it was before the 10.7.3 update. No matter what the volume is set to in the OS. Apple trying to get rid of that obnoxious sound so people will actually reboot their computer more often.

  • AV Receiver doesn't play TV sound

    Hi, we recently purchased the STRDH550 Sony AV system to work with out Samsung UHD TV. The components etc play through their respective inputs just fine, but I can't get the TV to play sound through the AV system. The TV Out component on the AV receiver is linked via HDMI 1.4 to the HDMI 1 input on the TV; the TV recognizes the AV system and I can even adjust the volume on the AV system using my TV remote. But no sound. Any advice? thanks, Jonathan

    Hi jgood986,
    Please check the links below for further assistance.
    https://us.en.kb.sony.com/app/answers/detail/a_id/33135/p/41901,43145,92877,92878/c/65,66/kw/arc
    https://us.en.kb.sony.com/app/answers/detail/a_id/30194/p/41901,43145,92877,92878/c/65,66/kw/arc
    https://us.en.kb.sony.com/app/answers/detail/a_id/35104/p/41901,43145,92877,92878/c/65,66/kw/arc
    Thanks,
    >Joffrey
    If my post answers your question, please mark it as "Accept as Solution"

  • My fullscreen playback doesn't play any sound

    I just go the latest iTunes update (as of 19th of September, 2013) and since then I haven't been able to play any of my movies, tv shows or podcasts with sound! Why is this? Please help ASAP!

    OK - I had this issue with iTune movies downloaded from store, newly with iTunes 11.1, affecting all movies, even those that were once fine.  The sound plays fine (Apple cinema display & sound) in large window mode but disappears on fullscreen (repeatably, coming back if fullscreen is exited).
    A fix that works for me is to switch back and forth between playing on this (my) machine and another local authorised machine using Airplay - of course you can do this without interrupting playback and without exiting fullscreen using the button on the control bar.  On re-selecting 'computer' after allowing the switch to complete the sound comes though fine, and this seems more-or-less stable once done*.  I do not know if the other machine works, too (it is a server with no normally-on display).
    FTR things that do NOT work include permnissions repair, reboot, re-alunch iTunes etc.
    *PS - it works but is not stable; you can switch in and out of fullscreen without losing sound but if you switch movies (or come back to a movie previously watched) you have to go round the loop again.  We need 11.2 please Apple!

  • Sequence doesn't play the sound.. help?

    Hey..
    I've just got FCE4 and I've encountered some problems. I've managed to overcome the "Not Rendered" issue, but now while I play the imported video already on the timeline, on the canvas, no sound is played. Not from the .dv files, and not from the mp3 file I just imported... This is a pain in the bottom, because I'm trying to make a narrational clip (like a review, you know) and without sound, I can't even start really editing what I want to do..
    is there a solution to this?
    thanks

    okay.. so I have EyeTV 250 Plus with which I can export to the following applications:
    Web
    iMovie (tho its broken)
    iMovie HD (tho its broken)
    iDVD
    DVD Studio Pro
    Toast
    PSP
    PSP (H.264)
    Apple TV
    iPhone
    iPod (Best)
    iPod (Smallest)
    iPod (Fastest)
    iTunes
    Native formats (no re-encoding):
    MPEG Program Stream
    MPEG Elementary Streams
    QuickTime Formats:
    DV
    DV 16:9
    HDV 720p
    HDV 1080i
    QuickTime Movie
    MPEG-4
    H.264
    3G
    DivX AVI
    AAC Audio
    Apple Lossless Audio
    Any of these good for FCE?
    And for sound.. I'm making stuff in GarageBand 08.. I can export to mp3 and aac.. or something else? maybe direct input into FCE from GB08? if not, is there a program that converts these to to AIFF?

  • Safari Extension On doesn't play embedded video

    Hi everybody,
    I've a Macbook pro with Lion and i'm using the last version of Safari.
    On many sites but also in facebook i cannot play the embedded video my friends are posting. Once i click on them it became a blank space in the middle of the page.
    I tried many solution but at the end the working one is to go into Safari Preferences, Extension and set it on OFF.
    Why?
    There's any solution about it?

    Carolyn Samit wrote:
    Hi and welcome.....
    Follow the instructions here to install QT 7
    Installing QuickTime Player 7 on Mac OS X v10.6 Snow Leopard
    Carolyn
    Carolyn Samit wrote:
    Hi and welcome.....
    Follow the instructions here to install QT 7
    Installing QuickTime Player 7 on Mac OS X v10.6 Snow Leopard
    Carolyn
    Thank you Carolyn. Nothing has changed.
    Enrico

  • Quicktime X doesn't play avi sound

    Hello, my quicktime player can open the video files but there will be no sound! It only happens for .avi though. Is there a certain codec I need or something?

    [Perian codecs for Quicktime|http://www.perian.org] - plugins to add functionality to Quicktime for playing additional audio and video formats
    [Quicktime audio problems, Perian, VLC|http://discussions.apple.com/message.jspa?messageID=9013669] - read note about uninstalling prior DIVX support before installing Perian.

  • Bluetooth sometimes does/sometimes doesn't play app sounds

    My iPad Air is successfully connecting to a Bose SoundLink II speaker with no problem.  Third party app sounds and music, however, sometimes play through the Bose speaker, but mostly play through the iPad speakers . . . even when the iPad shows that the Bose speaker IS connected. 
    When 3rd party app music is playing through the Bose, the control center in the app shows AirPlay and that Bose is the selected output (though it gives me the option of choosing the iPad speakers).  When that same app is playing through the iPad speakers, however, the control center does not show AirPlay and so does not give me the choice of choosing the Bose speakers.
    Any ideas?  The app I'm trying to use is called SoundCue (a very cool app BTW) and had been working flawlessly with my iPhone 5S and previous iPads.  Also, I reset the Bose and cleared all previously paired devices from it.
    Thanks for any ideas/help!
    Rick

    I listen to my music throughout the day, but sometimes when I go back to listen to my music on my droid x it will tell me that my phone does not support that media type.  It will do this to all music I have on the phone.  But when I shut the phone down and bring it back up the music works fine.  I have had to do this 5 times and I have only owned the phone for about a week.  Any suggestions?

  • Mac mini doesn't play stereo sound over HDMI

    My Mac mini (2012) is connected to my home theatre via HDMI.  While playing a 5.1 channe movie will play through the speakers fine, a stereo source will only play through the Mac's speakers.  This is true with iTunes Store content - if I slect Audio 1 (Stereo) it plays through the Mac speakers, if I select Audio 2 (5.1) it plays through my home theatre).
    Any suggestions?

    There are also some DVD sets with lots of supplement material on their discs, that you can only run with Interactual's DVD Player for the Mac.   Sadly, this software you need 10.6.8 or earlier to run:
    http://player.interactual.com/default.asp?code=PU
    See this tip on doing that if you have a Mac made on or after the release of 10.7:
    https://discussions.apple.com/thread/3913218
    Or just run Windows:
    https://discussions.apple.com/docs/DOC-2741

  • My repaired itouch doesn't play sounds

    Today, I just got a repair for my itouch that had a ******** screen touch that didn't respond. I never got a new one for the repair. It looked "new" but it waa actually something that has been fixed from a crappy one. Great, now it doesn't play a ******* sound without the earphones. What am I supposed to do now? Get a repair AGAIN?

    Yes. get it fixed again. Just like was said in a response (by other) to you post. Please do not double post in the future.other

  • Music album cover images and track titles show on iPhone 4s but music doesn't play - any ideas?

    I am a Young at Heart Senior, new to iPhone 4s, have an old creaking pc with Windows XP Home.....but plan to enter the real world any day soon by buying a new Mac!
    Here is my problem, I purchased an album on iTunes and mistakenly started to sync it to my phone, (although I don't have iCloud loaded on my pc). I stopped it mid download and later noticed that the total track numbers were showing as a red number above the "more" button as if they were waiting to complete the download. It stayed there while I thought about it for a few days, but when I click the Album button all the tracks are listed.
    Now to the funny part.....when I click on a track or indeed any of them, it doesn't play a sound...but the progress bar above moves as if "now playing".
    So, I thought.... no problem, I would connect the phone up to iTunes and delete the tracks....but when I do so, this album and none of it's track titles show in my music list for the phone......weird.
    So, I have a large album with titles only on my phone, no music behind the titles (which, incidentally, is rubbish anyway) and I can't get rid of it off my phone, any of you young whizzy iPhoners have any ideas how to clear it off???
    I did think I might just Restore my phone, but wondered whether downloading all my stuff from iCloud would still include the dreaded  "Now That's What I Call Christmas" album, which I only purchased in late 2011 to play at a seniors Xmas party...........you live and learn!
    You will guess from my ramblings that I am not at all techy, but consider myself willing to learn and apart from this hiccup........I luuuurve my iPhone!

    If you have all your music on the cmputer then i would connect up my phone uncheck the Sync Music option and apply.
    This should take all the music off your phone .Then you can resync the music back on to it.
    If this doesn't work maybe a restore to factory settings and start from scratch is the way to go

Maybe you are looking for

  • Automatic import of material data (csv file) from FTP directory

    Hello Experts, We created a Scheduled Task -> Data Import Monitor -> from a FTP directory. We loaded the .csv file with material data in the FTP folder but it is not getting imported.We have created the .csv file with the format of fields defined in

  • Redirect, System.out  ?

    Hi. I want to redirect System.out to a Swing Component like JTextArea, etc. try with printstream, Reader, etc. but i dont know how.!. I want to see, messages (The standard out) in a Swing Component. plis some help.. tnks.

  • Is it possible to output to fit on DVD?

    I have created a video in Premiere Pro and exported it to Encore and built menu's. The total length of the video is 2hrs & 8 minutes. Is there a way to output this to DVD to fit? maybe reducing quality of video or something? Thanks for your help.

  • Can I backup my iWeb site?

    I want to restore my mac. However, I want my site back. Can I backup my sites and put it back after restore?

  • Strengths and flaccidities of Service Desk

    Hi all. In your opinion, what are common strengths and flaccidities of the Service Desk in the Solution Manager? What things are important to name when talking about the Service Desk and his strengths and flaccidities? Thanks in advance. Best regards