×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    29

    Efficiency of playing sound

    Is there a reference describing the most efficient format to play sounds as and how to most efficiently play them with respect to memory management, taking into account how to deallocate memory. I noticed that the Player tends to cling onto resources.

  2. #2
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    307

    Re: Efficiency of playing sound

    If under the term "efficient" you mean high performances and low operating memory consumption, then the standard WAV format (with pure PCM samples) may be considered as the most efficient. However, the WAV format is an uncompressed one, so the persistent memory will be used unefficiently.

    Many standard multimedia formats are supported on the operating system level, so the Java is only connecting developer's code with to the native multimedia modules of the mobile platform. This way Java's Player is not consuming any resources, but simply provides the standard API to the multimedia applications.

  3. #3
    Registered User
    Join Date
    Feb 2006
    Location
    Brazil
    Posts
    523

    Re: Efficiency of playing sound

    if you don't want real songs (i.e. containing voices), you could consider using MID format.

    But if you do, AMR may be OK.Quality isn't as good as a WAV, but It consumes lower amount of memory.


    best regards
    Http_user_agent:
    NokiaN80-1/3.0 (4.0707.0.7)
    Series60/3.0
    Profile/MIDP-2.0
    Configuration/CLDC-1.1

  4. #4
    Registered User
    Join Date
    Feb 2007
    Posts
    29

    Re: Efficiency of playing sound

    Well what i mean iss how is the best way to allocate and deallocate memory when playing a wav for example. Say i got 100 different sounds which need to be played quickly after another. Say they need to be played randomly through a thread. So I dont know which order to pre allocate them in.

    Im having issues with too much memory being consumed (RAM) .

  5. #5
    Nokia Developer Expert
    Join Date
    Jul 2003
    Posts
    46

    Re: Efficiency of playing sound

    Since you have 100 samples played randomly don't bother trying to keep old Players in PREFETCHED or REALIZED states when they've played their content (the first time).

    In order to minimize memory usage and latency:
    - prefetch new Player while the previous one is playing
    - close the Player when it has finished playing
    - consider AMR, MP3 or AAC instead of WAV to minimime the use of static memory

  6. #6
    Registered User
    Join Date
    Feb 2007
    Posts
    29

    Re: Efficiency of playing sound

    Thanks for the reply. I did basically what you said paying high attention to deallocating memory once done. The reponse time is a little slow, but not too bad.

Similar Threads

  1. Sound recording and playing
    By sasa in forum Symbian
    Replies: 0
    Last Post: 2004-10-12, 13:41
  2. Problem on playing sound in emulator
    By mhahn0106 in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-01-12, 06:00
  3. strange problem playing Sound on 7650
    By Poldipold in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-07-11, 13:12
  4. Playing polyphonic sound on Series 30 and 40
    By shmoove in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2003-05-14, 14:09
  5. Playing wav sound with the nokia api
    By yuvalgeva in forum Mobile Java General
    Replies: 0
    Last Post: 2002-12-18, 12:50

Posting Permissions

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