×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    192

    Sound problems on Symbian 60 phones

    Hi,
    I am getting various problems when playing sounds on both emulator and physical phone.
    When I try to play a wav file I get the following error:
    java.lang.ClassCastException: com.sun.media.sound.RealTimeSequencer
    at com.nokia.phone.sdk.concept.mirrors.mma.media.player.MidiPlayer.doRealize(MidiPlayer.java)
    at com.nokia.phone.sdk.concept.mirrors.mma.media.player.TonePlayer.doRealize(TonePlayer.java)
    at com.nokia.phone.sdk.concept.mirrors.mma.media.player.BasicPlayer.realize(BasicPlayer.java)
    at com.nokia.phone.sdk.concept.mirrors.mma.media.MMAManager.init(MMAManager.java)
    at com.nokia.phone.sdk.concept.mirrors.mma.media.MMAManager.createPlayer(MMAManager.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.nokia.phone.sdk.concept.gateway.e.a(e.java)
    at com.nokia.phone.sdk.concept.gateway.e.run(e.java)
    at java.lang.Thread.run(Thread.java:595)

    but the sound in fact plays ok in the emulator.
    This is the code I use:
    InputStream is = Runtime.getRuntime().getClass().getResourceAsStream(fileSpec);
    Player p = Manager.createPlayer(is, "audio/x-wav");
    try
    {
    p.start();
    }
    catch (Exception ex)
    {
    System.out.println(ex.getMessage());
    System.out.println(ex);
    }

    When I try playing a midi file I get the same error, but in this case the file does not play at all.
    The same midis and wavs work fine on SE phones.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Sound problems on Symbian 60 phones

    Hi ed_welch,

    Please let us know which device you're talking about.

    BR,

    Juarez Junior

  3. #3
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    192

    Re: Sound problems on Symbian 60 phones

    The error message happens on the emultor.
    The actual phone I am using is a Nokia 6260

  4. #4
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Sound problems on Symbian 60 phones

    Hi,
    Please check the application settings whether the sound is set to OFF mode.Or is your phone in silent profile.
    thanks
    Soku

  5. #5
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: Sound problems on Symbian 60 phones

    hi ed_welch,

    Try calling p.prefetch() before u call p.start().

    ie;
    InputStream is = Runtime.getRuntime().getClass().getResourceAsStream(fileSpec);
    Player p = Manager.createPlayer(is, "audio/x-wav");
    try
    {
    p.prefetch();
    p.start();
    }
    catch (Exception ex)
    {
    System.out.println(ex.getMessage());
    System.out.println(ex);
    }


    Wang

  6. #6
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Sound problems on Symbian 60 phones

    Hello there,

    AFAIK it's not needed to call prefetch() if you call start() considering that it's called implicitly.

    "If start is called when the Player is in the UNREALIZED or REALIZED state, it will implicitly call prefetch."

    This is from the Javadocs.

    I cannot figure out exactly what the problem is, you talk about errors but it's not clear if they happen on emulator or on device. I'm sure Nokia 6260 implements MMAPI, though.

    BR,

    Juarez Junior

  7. #7
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    192

    Re: Sound problems on Symbian 60 phones

    Quote Originally Posted by juarezjunior
    Hello there,

    AFAIK it's not needed to call prefetch() if you call start() considering that it's called implicitly.

    "If start is called when the Player is in the UNREALIZED or REALIZED state, it will implicitly call prefetch."

    This is from the Javadocs.

    I cannot figure out exactly what the problem is, you talk about errors but it's not clear if they happen on emulator or on device. I'm sure Nokia 6260 implements MMAPI, though.

    BR,

    Juarez Junior
    Hello Juarez,
    The ClassCastException happens in the emulator the first time that I call Manager.createPlayer. The exception is not caught even though there is a catch block ( I don't know why).

  8. #8
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Sound problems on Symbian 60 phones

    Hi ed_welch,

    Have you solved this problem? Besides, have you tried it on the device?

    I cannot figure out the reasons why a ClassCastException would happen for your case...

    BR,

    Juarez Junior

  9. #9
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: Sound problems on Symbian 60 phones

    hi,

    @ed_welch
    maybe try "audio/wav" instead of "audio/x-wav" with the Manager.createPlayer(),
    I've remember similiar issue (exception) on Nokia TechLib,

    regards,
    Peter

  10. #10
    Registered User
    Join Date
    Mar 2003
    Posts
    28

    Re: Sound problems on Symbian 60 phones

    I'm having the same problem.

    If it's any help, the problem wasn't there until I upgraded to the beta 0.3 s60 emulator and java 1.5

    Even if I run an old version of my app, on the 0.2 emulator, I get this error.
    Maybe the installation altered some generic nokia libraries that all the emulators use..?

  11. #11
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    192

    Re: Sound problems on Symbian 60 phones

    Yeah, I'm using Java 1.5 too. And an old version of the Nokia SDK, beta 0.3.1 (It was the only one that I could get to work with Eclipse).
    Maybe that is the problem.

Similar Threads

  1. Sound Processing API for Symbian
    By larry_ger in forum Symbian
    Replies: 4
    Last Post: 2009-01-19, 12:19
  2. N70 Sound problems
    By golonko in forum Mobile Java Media (Graphics & Sounds)
    Replies: 20
    Last Post: 2006-05-09, 11:49
  3. Sound problems on the 6600?
    By ChiralSoftware in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-21, 20:12
  4. Nokia9210i Symbian Software Problems
    By psknokia in forum Symbian
    Replies: 0
    Last Post: 2004-03-17, 20:25
  5. problems with sound volume
    By the_professor11 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-03-09, 19:16

Posting Permissions

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