Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 20
Registered: ‎08-18-2008
My Device: Not Specified

Playing audio restarting Bold 9700

Hi devs,

I am facing a very different kind of problem on 9700

 

I just want to play a file through resources... I am using the following code.

 

 

Class clazz = Runtime.getRuntime().getClass();
InputStream is = clazz.getResourceAsStream("/siren.wav");
// create an instance of the player from the InputStream
Player player = javax.microedition.media.Manager.createPlayer(is,
"audio/wav");
player.realize();
player.prefetch();
player.setLoopCount(-1);
player.start();
is.close();

 

 

But on player.prefetch() device got restarted Smiley Sad ... (I found out through device debugger)

 

Am I doing some thing wrong?

 

Note: the same application is running fine in emulator.