You Are Here:

Community: Developer Discussion Boards

#1 Old Unhappy Streaming large mp3 file in Nokia 6680 - 2006-07-29, 02:53

Join Date: Jan 2006
Posts: 8
syson
Offline
Registered User
Hi

I've learnt through the forum that Nokia 6680 with older firmware cant play larger files. So i thought about streaming the file. The Nokia MMAPI tutorial suggests a way to stream file via HTTPConnection. I have tried to use the code on local file system with few changes as follows

public InputStream urlToStream(String url) throws IOException
{
// Open connection to the http url...
FileConnection connection = (FileConnection) Connector.open(url);
DataInputStream dataIn = connection.openDataInputStream();
byte[] buffer = new byte[1024];
int read = -1;
// Read the content from url.
ByteArrayOutputStream byteout = new ByteArrayOutputStream();
while ((read=dataIn.read(buffer))>=0)
{
byteout.write(buffer, 0, read);
}
dataIn.close();
connection.close();
// Fill InputStream to return with content read from the URL.
ByteArrayInputStream byteIn =
new ByteArrayInputStream(byteout.toByteArray());
return byteIn;
}}


Instead of HTTPConnection, i'm using FileConnection. The above method returns the InputStream, which i use to create a player as follows.

Player p = Manager.createPlayer(urlToStream("File:///..."),"audio/mpeg");

When i run the application on actual device, it asks for the read/write permission. The application, then waits for 3 to 4 seconds and exits. Please tell me if thats the right way or give me some other suggestion to play larger files (other than upgrading the firmware;-) ). Thanking in anticipation

syson
Reply With Quote

#2 Old Re: Streaming large mp3 file in Nokia 6680 - 2006-07-29, 17:15

Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
peterblazejewicz
Offline
Super Contributor
hi syson,

not sure what docs you are reffering, but 6680 does not have streaming support,
also you can stream only via rstp or http depending on os version:
from "Java Developer Library" (recent edition):
Quote:
Streaming

RTSP
The implementation supports Real Time Streaming Protocol (RTSP). RTSP player can be created by using the Manager.createPlayer method with the locator starting "rtsp://".
A RTSP network access point must be set from RealPlayer, or Player.prefetch throws MediaException with the error code -39. RTSP connections always use the default access point set in Real Player. Depending on the product and operator configuration, a default access point may be set automatically.
A 3G network connection is recommended to achieve smooth streaming
The playable content types can be queried dynamically by calling Manager.getSupportedContentTypes( "rtsp" ).
The supported content types for RTSP are listed in section Content types.

S60 3rd Ed. FP 1: HTTP
S60 3rd Ed. FP 1: HTTP streaming player is created using the Manager.createPlayer method with the locator starting "http://".
Contrary to RTSP streaming, a HTTP streaming network connection is not dependent on RealPlayer. Instead the default Internet connection access point is used. If a default access point has not been set, then an access point selection dialog is presented.

A 3G network connection is recommended to achieve smooth streaming

HTTP Streaming is supported only for the content type audio/amr. With other types, the media data is downloaded completely before playing.
InputStream

Streaming from an InputStream is not supported. All the data available in an InputStream is consumed into a buffer before a player is created.
regards,
Peter
Reply With Quote

#3 Old Unhappy Re: Streaming large mp3 file in Nokia 6680 - 2006-07-29, 23:32

Join Date: Jan 2006
Posts: 8
syson
Offline
Registered User
Hi Peter!

Thanks a million for sharing ur knowledge. As i mentioned in my first post, I'm just trying to develop an application which could play larger files even with small heap size. From ur message it seem impossible though :( Do u think there could be any other way of acheiving that end? Please give ur suggestion. Thanx

syson
Reply With Quote

#4 Old Re: Streaming large mp3 file in Nokia 6680 - 2006-07-30, 14:39

Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
peterblazejewicz
Offline
Super Contributor
hello,

#1
maybe if you are responsible to provide music assets for that phone try to convert mp3 to AAC music file format (its available as compression format e.g. in PC Suite tool) - mime type "audio/aac",
#2
try upgrading firmware version:
http://discussion.forum.nokia.com/fo...light=6680+mp3
your issues coudl be related to firmware on phone,

hth,
regards,
peter
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
About the nokia doc: A MIDlet Example Using the Wireless Messaging API ... SStefano Mobile Java Tools & SDKs 2 2008-04-03 20:02
URGENT: File Upload problem on Nokia 6680 eugeneleck General Browsing 0 2005-07-11 04:10
Java Compability emax73 General Discussion 0 2004-07-12 15:56
does Nokia 6230 and 7200 support WB-AMR file and vdo streaming? nogiafreak Audio 1 2003-11-28 14:13

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ