×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    4

    please help me!~~

    i have to finished this project
    at least next week

    can i play sound midi on nokia series 40?
    (series 40 is almost 4-poly isn't it?)

    if i can that how to play pholyphonic sound on nokia series40?

    if anyone has example code for play sound nokia series40

    if you have plz send to e-mail(returnti@hotmail.com)

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    You can't use J2ME to play MIDI on series 40 phones. And you can't use it to play polyphonic sound either.
    With J2ME series 40 phones only support the ringtone format (Sound.FORMAT_TONE).
    You can use the Nokia Developer's Suite to transform MIDI into the appropiate format, and then import the result into your application.
    To initialize the sound:
    Code:
    import com.nokia.mid.sound.Sound;
    
    //...
    
    InputStream soundStream = this.getClass().getResourceAsStream("/intro.txt");
    byte[] soundData = new byte[FILE_SIZE];
    soundStream.read(soundData,0,soundData.length);
    Sound mySound = new Sound(soundData,Sound.FORMAT_TONE);
    mySound.init(soundData,Sound.FORMAT_TONE);
    Then playing it is just a matter of calling the play() method:
    Code:
    mySound.play(numberOfLoops)

Posting Permissions

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