J2ME (MMAPI) Player option plroblem Urgent...

Hi all,

I am exploring about MMAPI. I wrote a small program to play a wav file from the jar file. But it is showing Exception. I dont know why it comes exception. The code is

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

import javax.microedition.media.*;

import javax.microedition.media.control.*;

import java.io.*;

private Player player;

private InputStream is;

publicvoid playRingTone()

{

try

{

is = getClass().getResourceAsStream("test-wav.wav");

player = Manager.createPlayer(is,"audio/X-wav");

player.start();

}

catch(IOException e)

{

System.out.println("Error = "+e);

}

catch (MediaException me)

{

System.out.println("Error = "+me);

}

}

Please check and help me to solve the problem to continue my other options in this API.

Thanking you,

Regards,

Dhanalakshmi

[1687 byte] By [Dhana.Ga] at [2007-11-26 18:52:16]
# 1
Dear Dhanalakshmi,I think you forgot a "/" before the filename.make it:is = getClass().getResourceAsStream("/test-wav.wav");cheers.
Akscorpa at 2007-7-9 6:26:18 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
Hi,Thankyou for ur reply. I have solved the problem. I have placed the wav file inside audio/X-wav. I put outside this folder as res/fall.wav. Now it is working...Regards,Dhanalakshmi
Dhana.Ga at 2007-7-9 6:26:18 > top of Java-index,Java Mobility Forums,Java ME Technologies...