Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!