S
steven robinson
Hi
I am having problems with media player. When there are other processes
running in the background or foreground the jmf media player starts
skipping and sounds terrible. Here is my code:
private void createPlayer()
{
if(file == null)
{
System.out.println("file has null content");
return;
}
removeOldPlayer();//remove earlier players
try
{
//create a new player
player = Manager.createPlayer(file.toURL());
player.addControllerListener(this);//add listener to my player
player.start();
}
catch(Exception e)
{
System.err.println("Error creating player, possible missing file");
}
The code works fine and plays the audio file with no problem, its only
when my computer is doing other things that the player goes to pot.
Should I be running the player in a thread? If so how do I do that, I
have no experience with threads. Please help.
Thanks
Steve
I am having problems with media player. When there are other processes
running in the background or foreground the jmf media player starts
skipping and sounds terrible. Here is my code:
private void createPlayer()
{
if(file == null)
{
System.out.println("file has null content");
return;
}
removeOldPlayer();//remove earlier players
try
{
//create a new player
player = Manager.createPlayer(file.toURL());
player.addControllerListener(this);//add listener to my player
player.start();
}
catch(Exception e)
{
System.err.println("Error creating player, possible missing file");
}
The code works fine and plays the audio file with no problem, its only
when my computer is doing other things that the player goes to pot.
Should I be running the player in a thread? If so how do I do that, I
have no experience with threads. Please help.
Thanks
Steve