• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!