×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Finding memories solutions for playing audio online

    Hi,
    I'm a new programmer working on j2me apps, I'm trying to create app to play music online, connect to server is and streaming is Ok. However, I got a problem about manage the memory. The memories in feature phone is quite small, so after stream it is able to read about 1M at one time, but audio file that I expect is about 30MB. So what is the solution for this issue.
    ps// I tried to using thread but that is quite bad because interruption between change the threads.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: Finding memories solutions for playing audio online

    That is normal. If you check device specifications (part of Devices above), you can find "Maximum Heap Size" listed under "Memory Functions". In case of Series 40 devices it varies between 1-4 megabytes.
    You may want to check the FileConnection API, a starting point could be http://www.developer.nokia.com/Commu...n_API_(JSR_75)

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,553

    Re: Finding memories solutions for playing audio online

    Quote Originally Posted by nokia1202 View Post
    after stream it is able to read about 1M at one time, but audio file that I expect is about 30MB. So what is the solution for this issue.
    That's, kind of, the point of streaming audio (or video); you do not need to download the whole thing to start playing it. So, the solution is to buffer enough to start playing (and handle the buffering delays) and download more as you play, then discard what you have already played, and play the new bits, etc.

    And with J2ME, to do multiple things "simultaneously", you do need to use threads (which won't really run simultaneously, at least not on a single-core processor, but will appear to do so).

    With other environments (e.g., on Symbian/S60) you could have separated the background loading to a separate service process and the front-end/UI into another (there you wouldn't have had similar memory issues, either).

    With the J2ME limitations in general, I'm not sure if it makes much sense to write any kind of streaming app (due to the memory and performance reasons) that has to both get, store and decode an audio or video stream. If you can hand over the control to an existing, native player from your J2ME app, that'd help, and might work, too (if the native player supports the encoding and streaming protocol), but the user experience with your app would be less than stellar.

    In other words, it might be very hard to get things working well for an audio streaming app using J2ME (and on phones with limited memory and processing power, and limited access to, e.g., hardware based codecs from J2ME).

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2012
    Location
    Surabaya, Indonesia
    Posts
    72

    Re: Finding memories solutions for playing audio online

    I have got this kind of problem before.
    I created a Java ME application which needs to play MP3 file which size is around 4-8 MB from HTTP Server.
    The easiest way to solve it is open the MP3 file in the native player.
    So you just need to open the file url in the MIDlet class like this: platformRequest ("http://localhost/test.mp3");

    It will be automatically downloaded and ran in the native player.

    Hope it helps.
    Jeffrey Hermanto Halimsetiawan
    Game Developer | Mobile Apps Developer
    LinkedIn

  5. #5
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Re: Finding memories solutions for playing audio online

    Hi jeffrey.halimsetiawan,
    The problem is that I don't want to download the MP3 file . Just play it.

  6. #6
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Re: Finding memories solutions for playing audio online

    Quote Originally Posted by petrib View Post
    That's, kind of, the point of streaming audio (or video); you do not need to download the whole thing to start playing it. So, the solution is to buffer enough to start playing (and handle the buffering delays) and download more as you play, then discard what you have already played, and play the new bits, etc.
    Thank you, petrib. I am on that way, but It's quite hard. I'll try my best.

Similar Threads

  1. Replies: 5
    Last Post: 2010-07-19, 14:08
  2. audio echo problem when recording and playing audio
    By kck809 in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2009-07-05, 09:42
  3. types of memories
    By raj8nokiaforum in forum Symbian
    Replies: 6
    Last Post: 2008-11-13, 07:02
  4. SOS-Nokia PC Connectivity SDK -Phone Memories
    By muneendra78 in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-07-01, 05:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×