开发者

playing audio from Application in blackberry?

I want to play audio from my application. the following code is used

 try{
     Player p = javax.microedition.media.Manager.c开发者_运维知识库reatePlayer("file:///store/home/user/recording.amr");
     p.realize();

     VolumeControl volume = (VolumeControl) p.getControl("VolumeControl");
     volume.setLevel(30);

      p.prefetch();
      p.start();
    }catch(MediaException me)
    {
        Dialog.alert(me.toString());
    } 
    catch(IOException ioe) 
    {
        Dialog.alert(ioe.toString());
    }

then i get an exception net.rim.device.internal.media.rimmediaexception : Media unloded while initializing

Any idea about this exception?


Read the rim article: http://docs.blackberry.com/en/developers/deliverables/11941/BlackBerry_Java_Application-Development_Guide--741609-1109114520-001-5.0_Beta-US.pdf

Refer thw stack ovewr flow link Radio Streaming in Blackberry

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜