BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-10-2007, 02:02 PM   #1 (permalink)
Thumbs Must Hurt
 
Spartan115's Avatar
 
Join Date: Aug 2007
Model: Pearl
PIN: N/A
Carrier: T-Mobile
Posts: 80
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Playing Music From a JAR or a RMS

Please Login to Remove!

I have the code to play music from a JAR or from an RMS:
(From an RMS)
Code:
RecordStore store;
int id;
// play back from a record store
try {
   InputStream is = new ByteArrayInputStream
     (store.getRecord(id));
   Player player = Manager.createPlayer(is, "audio/X-wav");
   p.start();
} 
catch (IOException ioe) {
} 
catch (MediaException me) {
}
...
(From a JAR)
Code:
try {
   InputStream is = 
     getClass().getResourceAsStream("audio.wav");
   Player player = Manager.createPlayer(is, "audio/X-wav");
   p.start();
} 
catch(IOException ioe) {
} 
catch(MediaException me) {
}
But what I want to know is how to actually get the music into the JAR from the RIM JDE or onto the record store.
If you guys don't know that, do you know how to make the default ring tone play?
Thanks a lot in advance
Offline  
Old 11-12-2007, 09:17 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can store any resource inside your cod file - include it in the jar file, which is compiled by rapc.
After this you can access it using Class.getResourceAsStream(<path/to/resource>) method.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

NEW Universal Magnetek BALLAST Metal Halide 1130-92-500K Replacement KIT Prewire
$13.49
NEW Universal Magnetek BALLAST Metal Halide 1130-92-500K Replacement KIT Prewire picture10 PHILIPS ADVANCE HCN2S5490CWL 347V-480V ELECTRONIC BALLAST 2 F54W/T5 347-480V
$360.0
10 PHILIPS ADVANCE HCN2S5490CWL 347V-480V ELECTRONIC BALLAST 2 F54W/T5 347-480V pictureSunlite 40300-SU SB50/MH/QT 50-watt Metal Halide Ballast Quad Tap Ballast Kit,
$55.38
Sunlite 40300-SU SB50/MH/QT 50-watt Metal Halide Ballast Quad Tap Ballast Kit, picture Valmont 8G1014W Ballast for (2) F96T12, F72T12 Bulbs
$24.0
 Valmont 8G1014W Ballast for (2) F96T12, F72T12 Bulbs picture1 MOTOROLA ELECTRONIC BALLAST-M2-CF-26-B-S-120
$19.99
1 MOTOROLA ELECTRONIC BALLAST-M2-CF-26-B-S-120 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.