Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to play a midi file

 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Is it possible to play a midi file from a J2ME application without using the MMAP(JSR 135). Or is there a owner API ( Nokia or Siemens etc .. )to play a midi file from a J2ME application.

Thanks in advance for you help.

OULD
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MIDP 2 should support midi playback without MMAPI
 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Michael,

Thanks you for your reply.
I would like learn more your solution:Could you give me more informations about the playback with midp 2.0.

Your solution enables my application to reach another devices MIDP2.0 without need to have the JSR 135. Do you have a some examples ?

I aim that my application reach the maximum of mobile.For example I wanted use the Nokia UI API: there is a function Sound(byte[] data, int type) to play a wave file: FORMAT_TONE or tone wave FORMAT_WAV. it doesn't play midi file. I can convert a midi file to a wave file. The wave file resulted has a big size. Then I can't use Nokia UI AP because my applicatin is based Client/Server.


OULD NADIF
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okey, there is a player API in MIDP 2.0 -- in the javax.microedition.media package. However, the spec does not say what media format it is required to play. I think most APIs including the Nokia UI API should play plain MIDI files. Make sure that your MIDI is not one of the fancy types (sp-midi? or something). I have many midi files that simply would not play on Nokia devices.
 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael.

1- May I undersatnd that all devices supporting MIDP2.0 support the javax.microedition.media package ?

2-the MIDP1.0 devices of Nokia supporting Nokia UI API can play a midi file (type 0) ?
I have a doubt for the second because I don't see any function that confirm it.The only function Sound(byte[] data, int type) can play a FORMAT_TONE or a FORMAT_WAV.

Cheers

OULD NADIF
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic