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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Developer
Posts: 46
Registered: ‎12-16-2010
My Device: Not Specified

Audio cuts out when I try to play using player.

Hello guys, in the app I am developing I download audio from a server and then play it back using the player class. Now the strange thing is this works 100% correctly in the emulator, but on the phone itself (8350i Nextel model) it downloads the same number of bytes but it cuts out the audio playing like about 95% though the audio and I can't detect that the audio ended through my player listener.


Here is my code for the downloader.

    FileConnection dest = (FileConnection)Connector.open("file:///store/home/user/documents/voting.mp3",Connector.READ_WRITE);

if (!dest.exists()) {
OutputStream outStream = dest.openOutputStream();
HttpConnection connection = null;
InputStream inputStream = null;

connection = (HttpConnection) Connector.open("http://server.mp3", Connector.READ_WRITE, true); //Can't give out real server link.
inputStream = connection.openInputStream();

byte[] Buffer = new byte[1024];
int temp = 0;
int amount = 0;
int length = (int)connection.getLength();
while ((amount != length)) {
temp = inputStream.read(Buffer);
amount = amount + temp; 



catch (Exception e){




and for the player:


String file = "file:///store/home/user/documents/voting.mp3" ;
myPlayer = Manager.createPlayer(file);
vc = (VolumeControl)

VotingListener v = new VotingListener();//Player Listener myPlayer.addPlayerListener(v);

} catch (Exception e) {




I am kinda clueless on why it would work exactly correctly through the emulator but not on the actual phone itself. Anyone got any ideas?