This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Bug Player on Nokia Handset serie 60  RSS feed

 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After playing 15 times there is bug:I tHink it is a problem of memory.
Before playing any new playing I call the stop function.

Here is my function that implements the player:

void playMusicBuffer(byte[] data) {

if((!bStartMedia) && (player==null)){

try {

//Jouer le buffer
ByteArrayInputStream isb = new ByteArrayInputStream(
data);
player = Manager.createPlayer(isb, "audio/mpeg");
player.addPlayerListener(this);
player.realize();
player. prefetch();
vc=null;
vc = getVolumeControl();
vc.setLevel(indiceVolume*20);
player.setLoopCount(-1);
player.start();
data = null;
Buffer = null;
bCancel = false;
System.gc();
Runtime runtime = Runtime.getRuntime();
totalMem = runtime.totalMemory();
memBefore = runtime.freeMemory();

}
catch (Exception ioe) {
ioe.printStackTrace();
System.out.println("playMusicBuffer Pb avec avec le flux entrant :");
}

}

}

Here is the function that implements the stop function:

void stopMusic() {

try {
if (player != null) {
player.stop();
player.close();
player = null;
bStartMedia = false;
} }
catch (IllegalStateException e) {
e.printStackTrace();
}
catch (Exception ioe) {
ioe.printStackTrace();
}


}


I don't understand why there is that bug. I made tests on Nokia 6680.


OULD NADIF
 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AND what is the bug??


- Ramy..
 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The bug is that the player can't play any song after 15 times of playing.

OULD NADIF
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!