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
Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Cannot programatically play audio files in storm

[ Edited ]

Hello all

 

I have written a code to play an audio file placed on a server.

The code works well for non touch device but not for touch device

Can anybody suggest what should i do?

 

 

 

PlayerThread  _playerThread = new PlayerThread();
_playerThread.start();

 

private class PlayerThread extends Thread
{
public void run()
{
try
{
String imgPath = url;
imgPath=imgPath + ";deviceside=true" + HttpRequestHelper.getConnectionparameter();

player = javax.microedition.media.Manager.createPlayer(imgPath);
playerListener = new MediaPlayerListener();
player.addPlayerListener(playerListener);
player.start();
LoginScreen.volumeControl = (VolumeControl) player.getControl("VolumeControl");
}
catch (final Exception e)
{
System.out.println("******Exception caught :" + e);
edit: got this exception,dont knw y coz my not using file system
net.rim.device.api.io.file.FileIOException: File system error }
}
}

 

private class MediaPlayerListener implements PlayerListener
 {
public void playerUpdate(Player player,String event,Object eventData)   
{
  if(event == STARTED){}
  else if(event == ERROR){}
  else if(event==END_OF_MEDIA){}
}
}

did some coding related to my app in this part
                        

 

need help !!!!!!!!!!!

 

Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: Cannot programatically play audio files in storm

Any help is highly appreciated

 

plz can anyone suggest me what should i do.

I have also tried with buffering and downloading a file and saving it in memory card and playing it again.

 

but the file does not play in any case

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: Cannot programatically play audio files in storm

Hi swati, I directly passed the Http Url of Audio file in the Player class and It works for me.

 

What are you getting.

Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: Cannot programatically play audio files in storm

Hey Nitin thanks fr the reply.

 

I have also tried that also but still no audio.

i can see it bufferring from the arrow at top right corner.

but no audio.

 

can u share your code if possible

may be m doing some stupid mistake.

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: Cannot programatically play audio files in storm

Give me your email id.

------------------------------------------------------------------------------------
Press Kudo to say thank to developer.
Also Press the Accept as solution Button when u got the Solution.