BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-10-2008, 06:59 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: pearl
PIN: N/A
Carrier: none
Posts: 20
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Mp3 Playback Problem

Please Login to Remove!

Hello,

So i ran into another problem. I am trying to retrieve a mp3 file on the web it on the blackberry device. However the code that i have successfully plays all mid files but fails on mp3 giving IOException in the call manager. The code is given below. After having doen all the reading, it seems that blackberry does support mp3 as its a standard jsr from j2me. So any inputs on whats wrong ?


i use a separate thread to play the files and get the stream.
Code:
	public void run(){
		try {
	    	  
			   HttpConnection conn = (HttpConnection)Connector.open(mp3url,Connector.READ_WRITE);
			    InputStream is = conn.openInputStream();
			    _player = Manager.createPlayer(is, "audio/mpeg");
			    _player.realize();
			    VolumeControl vc = (VolumeControl) _player.getControl("VolumeControl");
			    if(vc != null)
			    {
			      vc.setLevel(100);
			    }
			    _player.prefetch();	
				_player.start();
			  }				
			  catch(Exception e)
			  {
				  e.printStackTrace();
			  }
			}
any help is appreciated. Also if you have worked with mp3 over the network ( internet) before , please post
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.