File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes AUDIO PLAYERS Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "AUDIO PLAYERS" Watch "AUDIO PLAYERS" New topic
Author

AUDIO PLAYERS

Ryan Greenwood
Greenhorn

Joined: Jun 09, 2004
Posts: 3
InputStream is = getClass().getResourceAsStream("WHAT SHOULD THIS STRING HOLD - FILE NAME ONLY OR PACKAGE PATH OR WHAT?");
players[i] = Manager.createPlayer(is, "audio/basic");

IF ONLY A FILE NAME - WHERE SHOULD THE FILE BE STORED IN SUNS J2ME WDTK TO BE FOUND?
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Hello "greenman",

Please change your display name to conform to JavaRanch's naming policy, which you had agreed when you registered.

http://www.javaranch.com/name.jsp

About your question, the media files can be bundled inside the JAR file.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Ryan Greenwood
Greenhorn

Joined: Jun 09, 2004
Posts: 3
Hello Michael

My name is Ryan Greenwood which is a reserved log in by someone else. All other names attempted were met with the same message so I opted for a unique mail address.

Thanks for the note on the Jar file. I understand this is the prescribed way to package resources however the question is how do I specify the resources location such as "package/package/xxxxx.jar'. While developing it presumably is not necessary to package everything. I have placed the files in the res directory, in the class directory of my project amongst others, yet they remain unfound as InputStream is assigned null value.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Hi Ryan,

You do not need to change your login name. You just need to change your "display name" (or "screen name", or "nick name") so that it displays properly in your post. Thanks.

In order to access the resource files, you have to build the JAR file first. Some IDE tools might build the JAR automatically for you so you do not see it. In this case, you need to find out what your tool does behind the scene and what resource directory it choose to bundle into the JAR.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AUDIO PLAYERS
 
Similar Threads
Music and Lyrics
Cached audioclip
setting file association
Adjusting the master volume on the Windows/XP machine using JavaSound?
can we automate any audio player using java?