I m using the following code for play a sound file in j2me
try
{
String ctype_1 = "audio/x-wav";// #LINE 1
temp = Manager.createPlayer(this.getClass().getResourceAsStream(audioFileString),ctype_1 );
if(temp != null){
temp.setLoopCount(1);
temp.realize();
temp.prefetch() ;
return temp;
}
}
catch(Exceptio开发者_运维问答n ex)
{
ex.printStackTrace();
System.out.println("MediaException in my sound ==>"+ex);
}
at comment // #LINE 1 we have to give the content type (in this the type is for .wav file)
My question is that what content type i should give for the sound file .caf extension.
AFAIK .cfa file isn't supported by Java ME. Go through these articles,
MMAPI for Java ME
Finding audio format in Java ME
精彩评论