• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Calling Desktop.open() on an mp3 file fails

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using a JFileChooser to find an mp3 file:



And then trying to open with the default player (which is vlc on my computer):




However it fails with:


I have seen a couple of possible ways around it and tried what they suggested in:
http://bugs.sun.com/view_bug.do?bug_id=6599987
and:
http://www.experts-exchange.com/Programming/Languages/Java/Q_21035095.html

but can't seem to get it quite right. I continue to get different kinds of exceptions and am unable to play the file.

Could someone please tell me what I'm doing wrong?

Many thanks,

Peter.
 
Ranch Hand
Posts: 814
Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Peter,

Check your system privileges or check the required file condition that is normal or corrupted.
 
Peter Dennis
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ninad,

It is not a permission error. I am able to play the file through Windows Explorer no problem. I think it is more that I cannot get the syntax correct on transforming the path that I am receiving in 'soundFile' to a URI.

Any chance on getting some help with that?
 
mooooooo ..... tiny ad ....
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic