×

Discussion Board

Results 1 to 7 of 7

Thread: AMR in J2ME

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    AMR in J2ME

    How can i implements a AMR codec in J2ME ?
    Regards Antonio

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: AMR in J2ME

    Well...

    ...you can write code to convert data in a byte array... but I suspect that this is not what you're after.

    The codecs available on a device can be discovered by calling:
    Code:
    String[] types = javax.microedition.media.Manager.getSupportedContentTypes(null);
    You cannot extend this list from within the Java environment.

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    Re: AMR in J2ME

    Good morning, Graham...
    I'm sorry for my English, i'm Italian

    I'm implementing a player AMR in J2ME.
    To do this i've written:
    InputStream is=getClass().getResourceAsStream("/audioAmr.amr");
    try{
    player = Manager.createPlayer(is, "audio/amr");
    player.realize();
    player.start();}
    catch (IOException e)
    {e.printStackTrace();}

    Using the WTK emulator there aren't problem, everything works,
    because JVM accesses AMR codec by operating system.
    Using Symbian there aren't problem.
    The problem is that Windows Mobile don't allow it ... how can I do?

    Reguard Antonio

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: AMR in J2ME

    I understand.

    Not all devices will play AMR. It might not be possible.

    Use the code I gave you before to see what types the device will play.

    If AMR is not in the list, you cannot play it.

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    Re: AMR in J2ME

    ..but generally the KVM can run on Windows Mobile / Windows CE?

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: AMR in J2ME

    Sure... but the KVM is only the part that runs bytecode.

    You're asking about the functionality of the MIDP libraries. This varies HUGELY from one implementation to another.

    The specification for MIDP2 reads:
    Compliant MIDP 2.0 implementations:
    • MUST support Tone Generation in the media package.
    • MUST support 8-bit, 8 KHz, mono linear PCM wav format IF any sampled sound support is provided.
    • MAY include support for additional sampled sound formats.
    • MUST support Scalable Polyphony MIDI (SP-MIDI) and SP-MIDI Device 5-to-24 Note Profile IF any synthetic sound support is provided.
    • MAY include support for additional MIDI formats.
    Essentially, a device is not required to support any sound format. Certainly, many devices will not play AMR files.

    You can use:
    Code:
    String[] types = javax.microedition.media.Manager.getSupportedContentTypes(null);
    to find out what formats a device might play.

  7. #7
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    Smile Re: AMR in J2ME

    thanks....
    Regards, Antonio

Similar Threads

  1. convert AMR to PCM failed
    By goodtaste in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-12-30, 08:41
  2. J2ME or C++ for VoIP on Mobile
    By sandeepkumar03 in forum VoIP
    Replies: 4
    Last Post: 2009-02-02, 10:28
  3. J2ME or C++ for VoIP on Mobile Phone
    By sandeepkumar03 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2008-11-13, 20:14
  4. How can I implement Codec AMR, G.729 A/B, G.711 in J2ME
    By shaikot in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2008-09-05, 23:39
  5. J2ME Polish Version 1.0 RC6
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-07-20, 11:25

Posting Permissions

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