dcsimg
JMF: howto play WAV from inside JAR
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Patrick_ZIMA
Posted On:   Friday, September 6, 2002 05:22 AM

For migrating my app to JavaWebStart, I'd like to place the alertsound of my java-app into a jar-file.


URL mediafile = new URL("new String("jar:file:/C:/tmp/lib/res.jar!/res/alert.wav")");


But trying to initialize the Player with somthing like


Player player = Manager.createPlayer(mediafile);


errors in:


javax.media.NoPlayerException: Cannot find a Player for :jar:file:/C:/tmp/lib/res.jar!/res/alert.wav




pls, help I'm going mad on that problem soon ...
regards Pat

Re: JMF: howto play WAV from inside JAR

Posted By:   Chris_Adamson  
Posted On:   Thursday, November 14, 2002 01:14 PM


I did something similar for an O'Reilly article, maybe it will help:

http://www.onjava.com/pub/a/onjava/2002/10/09/jmf.html


--Chris

Re: JMF: howto play WAV from inside JAR

Posted By:   Nikolai_Klimov  
Posted On:   Wednesday, September 25, 2002 04:29 PM

Try this:



URL mediafile = new URL(getClass().getResource("/res/alert.wav"));




You must pack "res"-directory to your jar-File
About | Sitemap | Contact