Audio file problem

The netbeans compiles okay but mobile emulator can not play sound file (.amr). as I dont have download accessories, I can't test the code on my phone. Any idea?

....

elseif (c == playCommand)

{

start();

this.removeCommand(playCommand);

this.addCommand(pauseCommand);

}

elseif (c == pauseCommand)

{

pause();

this.removeCommand(pauseCommand);

this.addCommand(playCommand);

}

}

publicvoid start()

{

Thread t =new Thread(this);

t.start();

}

// to prevent blocking, all communication should be in a thread and not in commandAction

publicvoid run()

{

play();

}

void play()

{

try

{

if(p==null || !(p.getMediaTime()<p.getDuration()))

{

String fName = this.currentHS.getSoundFilename();

if(fName==null)

{

this.removeCommand(pauseCommand);

this.addCommand(playCommand);

return;

}

InputStream is = this.getClass().getResourceAsStream(fName);

p = Manager.createPlayer(is,"audio/amr");

p.addPlayerListener(this);

p.prefetch();

p.realize();

p.start();

}

else

{

p.start();

}

}

catch(IOException e)

{

System.out.println("Error in io : " + e.toString());

}

catch(MediaException e)

{

System.out.println("Error in media : " + e.toString());

}

}

void pause()

{

try

{

p.stop();

}

catch(MediaException e)

{

System.out.println("Error in media : " + e.toString());

}

}

publicvoid playerUpdate(Player player, String str, Object obj)

{

if(str.toLowerCase().equals("endofmedia"))

{

this.removeCommand(pauseCommand);

this.addCommand(playCommand);

}

}

.......

>

[3840 byte] By [mmt2020a] at [2007-10-3 3:30:51]
# 1
Hi,I also tried this before i have faced the same problems, but resolved when i edited the file mma.xml of the emulator but this code(above) will run fine on device definitly I tried it on phone it runs fine @rjun
arjunamatea at 2007-7-14 21:24:49 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
Thanks a lot. I was also suspecting that. btw, what should be edited? and, if edited, will it effect when i download it to a real device?Again thanks.
mmt2020a at 2007-7-14 21:24:49 > top of Java-index,Java Mobility Forums,Java ME Technologies...