This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Is it possible to play a midi file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Is it possible to play a midi file" Watch "Is it possible to play a midi file" New topic
Author

Is it possible to play a midi file

Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
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


We are ones that build the world, thus build it well.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
MIDP 2 should support midi playback without MMAPI


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
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

Joined: Mar 07, 2002
Posts: 1427
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

Joined: Jan 21, 2004
Posts: 184
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
 
GeeCON Prague 2014
 
subject: Is it possible to play a midi file