×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    Question In J2ME app, is that possible to set alarm's ringtone as MP3 tone??

    In J2ME app, I want to give freedom to user to set his/her own liking tone as alarm tone though it is .mp3 or .wav sound with high bit rate & size. It is possible in J2ME with javax.microedition.media package??

    I tried to do this with one .wav file whose size is 2.52MB and bit rate is 352kpbs but Netbeans showed me exception which is
    java.lang.OutOfMemoryError
    at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(Display.java:1996)
    at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(Display.java:2825)
    at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(DefaultEventHandler.java:303)
    at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(AutomatedEventHandler.java:670)
    at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+186)
    at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)

    So is there any way to do this or I have to restrict user to use tone which is provided with app....

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: In J2ME app, is that possible to set alarm's ringtone as MP3 tone??

    Quote Originally Posted by Rahul More View Post
    In J2ME app, I want to give freedom to user to set his/her own liking tone as alarm tone though it is .mp3 or .wav sound with high bit rate & size. It is possible in J2ME with javax.microedition.media package??

    I tried to do this with one .wav file whose size is 2.52MB and bit rate is 352kpbs but Netbeans showed me exception which is
    java.lang.OutOfMemoryError
    at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(Display.java:1996)
    at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(Display.java:2825)
    at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(DefaultEventHandler.java:303)
    at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(AutomatedEventHandler.java:670)
    at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+186)
    at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)le

    So is there any way to do this or I have to restrict user to use tone which is provided with app....
    You need to limit the size of the tone file - depending on the available free memory of your target device - which is your target device ?
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    Re: In J2ME app, is that possible to set alarm's ringtone as MP3 tone??

    Quote Originally Posted by im2amit View Post
    You need to limit the size of the tone file - depending on the available free memory of your target device - which is your target device ?
    I am still not decided target device; my app is GPS based so what should be my target device. I am not getting how & which target device should I choose. Kindly guide me to choose target device sir.......

    But it is possible to play .mp3 sound in javax.microedition.media package???
    Last edited by Rahul More; 2012-12-31 at 06:53.

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: In J2ME app, is that possible to set alarm's ringtone as MP3 tone??

    Quote Originally Posted by Rahul More View Post
    I am still not decided target device; my app is GPS based so what should be my target device. I am not getting how & which target device should I choose. Kindly guide me to choose target device sir.......

    But it is possible to play .mp3 sound in javax.microedition.media package???
    yes, .mp3 can be played by j2me - if the device supports it.

    But size of the file will always be a limited based on available free memory - or use some logic to create your own data source - which reads some bytes of music from file and passes it to media player - not a easy task to do - if device supports streaming - try streaming mp3 - as your alarm... and you will not need to worry about size.

    As you need GPS on the device, try to take a device with good memory capabilities - check out the specs at http://www.developer.nokia.com/Devic...pecifications/
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    Re: In J2ME app, is that possible to set alarm's ringtone as MP3 tone??

    After creating a player with one audio file by using method - player = Manager.createPlayer(getClass().getInputStream("/sound.wav"), "audio/x-wav") , Is that possible to pass an another audio file to same instance of player??

    I tried by doing this one -
    player = (Player) player.getClass().getInputStream("/sound2.wav");
    but this one give me an exception which is - java.lang.ClassCastException

    if possible then how it should be done?
    Last edited by Rahul More; 2013-01-04 at 10:34.

  6. #6
    Registered User
    Join Date
    Dec 2012
    Location
    Mumbai, Maharashtra, India
    Posts
    79

    Question Re: In J2ME app, is that possible to set alarm's ringtone as MP3 tone??

    In J2ME How to find the capability of emulator to check whether it can play certain media file or not
    Last edited by Rahul More; 2013-01-04 at 11:05.

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: In J2ME app, is that possible to set alarm's ringtone as MP3 tone??

    In J2ME How to find the capability of emulator to check whether it can play certain media file or not
    You can use try/catch with Exception handling - to identify it in runtime...

    for more refer to http://docs.oracle.com/javame/config...135/index.html
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. S40 Java PIM API tone alarm
    By nokiauser2 in forum Mobile Java General
    Replies: 0
    Last Post: 2009-08-11, 22:05
  2. Alarm tone in Series 40 with PIM API
    By pom_cc in forum Mobile Java General
    Replies: 0
    Last Post: 2007-06-28, 11:06
  3. N70 Custom Alarm tone ?
    By edward.quan in forum Audio
    Replies: 0
    Last Post: 2006-02-16, 18:25
  4. alarm tone
    By gulanfer in forum General Development Questions
    Replies: 1
    Last Post: 2003-11-13, 08:26

Posting Permissions

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