Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Not able to playback audio files

[ Edited ]

Hi,

 

Im trying to play recorded wave file.While playing,exception is thrown at foll. stmt.:

 

 

Player player = Manager.createPlayer(is, "audio/mpeg");

 My entire code for playing wave file is as follows:

 

 

 

if (types[cnt].equals("audio/x-wav")) { 

Class clazz = Class.forName("RecordAudio");

InputStream is = clazz.getResourceAsStream("file:///SDCard/BlackBerry/original.wav");

 

//create an instance of the player from the InputStreamPlayer player = Manager.createPlayer(is, "audio/mpeg");

player.realize();

player.prefetch();

//start the playerplayer.start();

 

 

 

 

 Please help me out.

Thanks in advance. 

 

Message Edited by tejaswini on 09-01-2009 06:03 PM
Message Edited by tejaswini on 09-02-2009 09:37 AM
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Re: Not able to play wav file

.mp3 files are also not played...

Please help