×

Discussion Board

Results 1 to 3 of 3

Hybrid View

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

    WAV on my Nokia 6610

    I'm developing an app for my Nokia 6610 the first time and
    got stuck in a very interesting problem:

    I'm using the following function to load a wav-file:

    private void loadSound()
    {
    InputStream tune;
    tune = this.getClass().getResourceAsStream("/Bounce.wav");
    soundBuffer = new byte[11069];
    try {
    tune.read(soundBuffer, 0, soundBuffer.length);
    } catch (IOException e)
    {
    }
    System.out.println("reading fine so far");
    try {
    sound = new Sound(soundBuffer, Sound.FORMAT_WAV);
    } catch (IllegalArgumentException e)
    {
    System.out.println("Illegal argument - "+e);
    }
    sound.init(soundBuffer, Sound.FORMAT_WAV);
    }


    And although the function Sound.getSupportedFormats() returns
    a 5 (FORMAT_WAV) too, the loading fails all the time.

    On the Series 60 Emulator it works fine, but since my phone is
    Series 40 I tried it on the Series 40 Emulator and on the Nokia 7210 emulator - both fail with an "IllegalArgumentExecption: invalid type".

    One interesting thing: the trace output for the exception shows me that the loading fails in

    com.nokia.mid.sound.Sound.initRingingTone

    but I'm loading a wav file not a ringing tone !

    Thanks for any help
    Michael

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    8

    Only series60 that supports WAV :(

    Hi Michael,

    I tried to find out which soundformats that the different Nokia -Series30, Series40 and Series60 supported by putting these two lines in a midlet:

    int[] sounds=Sound.getSupportedFormats();
    for (int i=0;i<sounds.length;i++) System.out.println("Sound"+i+":"+sounds[i]);

    The "Nokia_Series_40_MIDP_Concept_SDK_Beta_0_1"-emulator does say that it supports WAV-format, but that is a bug in the emulator, I think. If you try the "Nokia_7210_MIDP_SDK_Beta_0_1" - emulator it seems like it only supports the ringtone format.

    Kind Regards,
    Espen

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    3
    You're right. I queried the sound formats on my mobile phone and
    it only supports ringing tones as I found out.

    Thanks for your reply
    Michael

Posting Permissions

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