×

Discussion Board

Results 1 to 5 of 5

Thread: 7650 wav error

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    7650 wav error

    Hi,
    I'm trying to play a five second wav on a Nokia 7650 - when the code below tries playing the wav, the app closes and an error message is displayed with:

    App. closed
    jes-1f1-javax.microedition.lcdui0@1...
    CMdaAudioPlayerU 2


    /* code start */
    try{
    InputStream tune = this.getClass().getResourceAsStream("/resources/sound/4.wav"
    byte[] bytes = new byte[50000];
    tune.read(bytes,0,bytes.length);
    Sound talk_S=new Sound(bytes,Sound.FORMAT_WAV);
    talk_S.init(bytes,Sound.FORMAT_WAV);
    talk_S.setGain(40);
    talk_S.setSoundListener(this);
    talk_S.play(1);
    }
    catch(Exception e){
    osText p4_item_ex = new osText(debugNo + " "
    thisPageItems.addElement(p4_item_ex);
    osText p4_item_ex2 = new osText(e.toString());
    thisPageItems.addElement(p4_item_ex2);
    }

    /* code end */

    If I remove the line
    talk_S.setGain(40);

    No error is reported but equally no sound plays.

    Any suggestions?

    Mal

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    RE: 7650 wav error

    The setGain is what is causing the crash - this is a known problem. Are you sure the wave file is compatible? Try sending it to the phone as a file and see whether you can play it in the sound recorder application.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    4
    Hi,

    I had huge problems with .wav files... they were never played...
    Problem was that I belived to the posting that 7650 will play 16 bit 8 kHz files with ADPCM compression... I took that as a fact because someone from nokia support wrote that.
    Well, obviously, the person that wrote this has no clue about what 7650 can! I spent the whole day trying to get some tone out of the phone with no success until I conevrted my sounds back to:
    8bit, 22 kHz, mono
    This will work for sure!

    Also, you should remove the setGain from your code... this command is definitely not working.

    Regards,
    Dejan.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    all sorted

    Hi just an update,

    The ultimate problem was unfortunatly a defective 7650 ;-(

    Thanks for the comments though!

    Mal

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    12
    But the setGain is still busted.
    Do NOT use it.

Posting Permissions

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