play midi in nokia 7210

desuzhe 2004-06-17 02:56:05
is anyone kown how to play midi in nokia 7210,thanks
...全文
203 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
nik_Amis 2004-09-20
  • 打赏
  • 举报
回复
wanglefox(Wanglefox) 请问怎么加入jar啊?

到哪里去下载那个jar?
wanglefox 2004-09-17
  • 打赏
  • 举报
回复
或者在编译器里加入Nokia的jar。
wanglefox 2004-09-17
  • 打赏
  • 举报
回复
晕,你用的什么模拟器?
如果不是Nokia的S40系统的手机模拟器,是找不到的。
不过如果你直接打包后在支持该com.nokia.*的手机上运行就OK了~
nik_Amis 2004-09-17
  • 打赏
  • 举报
回复
prok(菜菜)你太好了,谢谢!!

但是import com.nokia.*;好想说找不到是怎么回事儿啊
prok 2004-09-17
  • 打赏
  • 举报
回复
(byte)0x14, (byte)0x51, (byte)0x2a, (byte)0xa4,
(byte)0x93, (byte)0x08, (byte)0x51, (byte)0x44,
(byte)0xaa, (byte)0x92, (byte)0x4c, (byte)0x51,
(byte)0x2a, (byte)0x20, (byte)0xd3, (byte)0x08,
(byte)0x51, (byte)0x26, (byte)0xaa, (byte)0x83,
(byte)0x4c, (byte)0x49, (byte)0xaa, (byte)0x20,
(byte)0xe3, (byte)0x08, (byte)0x51, (byte)0x27,
(byte)0x20, (byte)0x83, (byte)0x8c, (byte)0x21,
(byte)0x44, (byte)0x9c, (byte)0xa9, (byte)0x26,
(byte)0x10, (byte)0x82, (byte)0x89, (byte)0x55,
(byte)0x24, (byte)0x98, (byte)0x42, (byte)0x8a,
(byte)0x25, (byte)0x54, (byte)0x92, (byte)0x60,
(byte)0x00
};

ph[1] = new Sound(data,Sound.FORMAT_TONE );
ph[2] = new Sound(data1,Sound.FORMAT_TONE );
ph[3] = new Sound(data2,Sound.FORMAT_TONE );
////byteArr.close();




//}
// din.close();
ph[1].play(1);
// ph[2].play(0);
// ph[3].play(0);
}
catch(Exception snde){
System.out.println("sound data read > Exception");
}

}

public soundplay() {
instance = this;
Display.getDisplay(this);
}

public void startApp() {
playsound();
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

public static void quitApp() {
instance.destroyApp(true);
instance.notifyDestroyed();
instance = null;
}

}
prok 2004-09-17
  • 打赏
  • 举报
回复
byte[] data1 = {
(byte)0x02, (byte)0x4a, (byte)0x3a, (byte)0x40,
(byte)0x04, (byte)0x00, (byte)0x1f, (byte)0x1e,
(byte)0x48, (byte)0x08, (byte)0x34, (byte)0x92,
(byte)0x14, (byte)0x38, (byte)0x43, (byte)0x20,
(byte)0x49, (byte)0x22, (byte)0x14, (byte)0x21,
(byte)0x20, (byte)0x20, (byte)0xd2, (byte)0x48,
(byte)0x50, (byte)0xe1, (byte)0x00, (byte)0x00,

};
byte[] data2 = {
(byte)0x02, (byte)0x4a, (byte)0x3a, (byte)0x40,
(byte)0x04, (byte)0x01, (byte)0xff, (byte)0x1e,
(byte)0x49, (byte)0x84, (byte)0x20, (byte)0xa2,
(byte)0x55, (byte)0x49, (byte)0x26, (byte)0x10,
(byte)0xa2, (byte)0x89, (byte)0x55, (byte)0x24,
(byte)0x98, (byte)0x42, (byte)0x8a, (byte)0x25,
(byte)0x54, (byte)0x92, (byte)0x62, (byte)0x89,
(byte)0x51, (byte)0x06, (byte)0x98, (byte)0x42,
(byte)0x89, (byte)0x35, (byte)0x54, (byte)0x1a,
(byte)0x62, (byte)0x4d, (byte)0x51, (byte)0x07,
(byte)0x18, (byte)0x42, (byte)0x89, (byte)0x39,
(byte)0x04, (byte)0x1c, (byte)0x61, (byte)0x0a,
(byte)0x24, (byte)0xe5, (byte)0x49, (byte)0x30,
(byte)0x84, (byte)0x14, (byte)0x4a, (byte)0xa9,
(byte)0x24, (byte)0xc2, (byte)0x14, (byte)0x51,
(byte)0x2a, (byte)0xa4, (byte)0x93, (byte)0x08,
(byte)0x51, (byte)0x44, (byte)0xaa, (byte)0x92,
(byte)0x4c, (byte)0x51, (byte)0x2a, (byte)0x20,
(byte)0xd3, (byte)0x08, (byte)0x51, (byte)0x26,
(byte)0xaa, (byte)0x83, (byte)0x4c, (byte)0x49,
(byte)0xaa, (byte)0x20, (byte)0xe3, (byte)0x08,
(byte)0x51, (byte)0x27, (byte)0x20, (byte)0x83,
(byte)0x8c, (byte)0x21, (byte)0x44, (byte)0x9c,
(byte)0xa9, (byte)0x26, (byte)0x10, (byte)0x82,
(byte)0x89, (byte)0x55, (byte)0x24, (byte)0x98,
(byte)0x42, (byte)0x8a, (byte)0x25, (byte)0x54,
(byte)0x92, (byte)0x61, (byte)0x0a, (byte)0x28,
(byte)0x95, (byte)0x52, (byte)0x49, (byte)0x8a,
(byte)0x25, (byte)0x42, (byte)0x00, (byte)0x21,
(byte)0x44, (byte)0x92, (byte)0x61, (byte)0x08,
(byte)0x28, (byte)0x95, (byte)0x52, (byte)0x49,
(byte)0x84, (byte)0x28, (byte)0xa2, (byte)0x55,
(byte)0x49, (byte)0x26, (byte)0x10, (byte)0xa2,
(byte)0x89, (byte)0x55, (byte)0x24, (byte)0x98,
(byte)0xa2, (byte)0x54, (byte)0x41, (byte)0xa6,
(byte)0x10, (byte)0xa2, (byte)0x4d, (byte)0x55,
(byte)0x06, (byte)0x98, (byte)0x93, (byte)0x54,
(byte)0x41, (byte)0xc6, (byte)0x10, (byte)0xa2,
(byte)0x4e, (byte)0x41, (byte)0x07, (byte)0x18,
(byte)0x42, (byte)0x89, (byte)0x39, (byte)0x52,
(byte)0x4c, (byte)0x21, (byte)0x05, (byte)0x12,
(byte)0xaa, (byte)0x49, (byte)0x30, (byte)0x85,
(byte)0x14, (byte)0x4a, (byte)0xa9, (byte)0x24,
(byte)0xc2, (byte)0x14, (byte)0x51, (byte)0x2a,
(byte)0xa4, (byte)0x93, (byte)0x14, (byte)0x4a,
(byte)0x88, (byte)0x34, (byte)0xc2, (byte)0x14,
(byte)0x49, (byte)0xaa, (byte)0xa0, (byte)0xd3,
(byte)0x12, (byte)0x6a, (byte)0x88, (byte)0x38,
(byte)0xc2, (byte)0x14, (byte)0x49, (byte)0xc8,
(byte)0x20, (byte)0xe3, (byte)0x08, (byte)0x51,
(byte)0x27, (byte)0x2a, (byte)0x49, (byte)0x84,
(byte)0x20, (byte)0xa2, (byte)0x55, (byte)0x49,
(byte)0x26, (byte)0x10, (byte)0xa2, (byte)0x89,
(byte)0x55, (byte)0x24, (byte)0x98, (byte)0x42,
(byte)0x8a, (byte)0x25, (byte)0x54, (byte)0x92,
(byte)0x62, (byte)0x89, (byte)0x51, (byte)0x06,
(byte)0x98, (byte)0x42, (byte)0x89, (byte)0x35,
(byte)0x54, (byte)0x1a, (byte)0x62, (byte)0x4d,
(byte)0x51, (byte)0x07, (byte)0x18, (byte)0x42,
(byte)0x89, (byte)0x39, (byte)0x04, (byte)0x1c,
(byte)0x61, (byte)0x0a, (byte)0x24, (byte)0xe5,
(byte)0x49, (byte)0x30, (byte)0x84, (byte)0x14,
(byte)0x4a, (byte)0xa9, (byte)0x24, (byte)0xc2,
prok 2004-09-17
  • 打赏
  • 举报
回复
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import com.nokia.*;
import java.io.*;
import java.util.*;
import com.nokia.mid.sound.Sound;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/

public class soundplay extends MIDlet {
static soundplay instance;
private DataInputStream din;
private Sound ph[] = new Sound [4];
public void playsound() {

int fsize;
int i = 0;
int fnum ;
try {




//din = new DataInputStream((Class.forName("soundplay").getResourceAsStream("1.mid")));

//fnum = din.readInt();

//for(i = 0; i < fnum; i++){
// ByteArrayOutputStream byteArr = new ByteArrayOutputStream(192);


//fsize = din.readInt();

//din.readFully(buf, 0, fsize);


// byteArr.write(buf, 0, fsize);
byte[] data = {
(byte)0x02, (byte)0x4a, (byte)0x3a, (byte)0x40,
(byte)0x04, (byte)0x01, (byte)0x0f, (byte)0x18,
(byte)0x55, (byte)0x84, (byte)0x18, (byte)0x55,
(byte)0x85, (byte)0xd8, (byte)0x4d, (byte)0xa4,
(byte)0x20, (byte)0x83, (byte)0x4c, (byte)0x34,
(byte)0xc4, (byte)0x95, (byte)0x61, (byte)0x36,
(byte)0x15, (byte)0x61, (byte)0x76, (byte)0x13,
(byte)0x41, (byte)0x06, (byte)0x17, (byte)0x61,
(byte)0x86, (byte)0x17, (byte)0x61, (byte)0x38,
(byte)0x10, (byte)0x81, (byte)0x36, (byte)0x15,
(byte)0x69, (byte)0x06, (byte)0x10, (byte)0x81,
(byte)0x76, (byte)0x18, (byte)0x61, (byte)0x76,
(byte)0x13, (byte)0x81, (byte)0x08, (byte)0x13,
(byte)0x81, (byte)0x08, (byte)0x13, (byte)0x69,
(byte)0x5a, (byte)0x13, (byte)0xa1, (byte)0x26,
(byte)0x90, (byte)0x81, (byte)0x56, (byte)0x10,
(byte)0x61, (byte)0x56, (byte)0x17, (byte)0x61,
(byte)0x36, (byte)0x90, (byte)0x82, (byte)0x0d,
(byte)0x30, (byte)0xd3, (byte)0x12, (byte)0x55,
(byte)0x84, (byte)0xd8, (byte)0x55, (byte)0x85,
(byte)0xd8, (byte)0x4d, (byte)0x04, (byte)0x18,
(byte)0x5d, (byte)0x86, (byte)0x18, (byte)0x5d,
(byte)0x84, (byte)0xe0, (byte)0x42, (byte)0x04,
(byte)0xd8, (byte)0x55, (byte)0xa4, (byte)0x18,
(byte)0x42, (byte)0x05, (byte)0xd8, (byte)0x61,
(byte)0x85, (byte)0xd8, (byte)0x62, (byte)0x04,
(byte)0x20, (byte)0x6a, (byte)0x04, (byte)0x20,
(byte)0x69, (byte)0x08, (byte)0x34, (byte)0xc3,
(byte)0x8c, (byte)0x49, (byte)0x36, (byte)0x90,
(byte)0x81, (byte)0x56, (byte)0x17, (byte)0x61,
(byte)0xa6, (byte)0x90, (byte)0x81, (byte)0x76,
(byte)0x1a, (byte)0x61, (byte)0xc6, (byte)0x28,
(byte)0x93, (byte)0x12, (byte)0x71, (byte)0x86,
(byte)0x98, (byte)0x5d, (byte)0xa4, (byte)0x20,
(byte)0x55, (byte)0x85, (byte)0xd8, (byte)0x69,
(byte)0x85, (byte)0xda, (byte)0x42, (byte)0x05,
(byte)0xd8, (byte)0x55, (byte)0x85, (byte)0xd8,
(byte)0x55, (byte)0x84, (byte)0xd8, (byte)0x83,
(byte)0x44, (byte)0x20, (byte)0x83, (byte)0x4c,
(byte)0x38, (byte)0xc4, (byte)0x93, (byte)0x69,
(byte)0x08, (byte)0x15, (byte)0x61, (byte)0x76,
(byte)0x1a, (byte)0x69, (byte)0x08, (byte)0x17,
(byte)0x61, (byte)0xa6, (byte)0x1c, (byte)0x62,
(byte)0x89, (byte)0x31, (byte)0x27, (byte)0x18,
(byte)0x69, (byte)0x85, (byte)0xda, (byte)0x42,
(byte)0x05, (byte)0x58, (byte)0x5d, (byte)0x86,
(byte)0x98, (byte)0x5d, (byte)0xa4, (byte)0x20,
(byte)0x5d, (byte)0x85, (byte)0x58, (byte)0x5d,
(byte)0x85, (byte)0x58, (byte)0x4d, (byte)0x88,
(byte)0x34, (byte)0x40, (byte)0x00
};
nik_Amis 2004-09-14
  • 打赏
  • 举报
回复
谁有MIDP1.0播放声音的例子啊?
prok 2004-09-14
  • 打赏
  • 举报
回复
支持wav.
sbamdanb00 2004-09-07
  • 打赏
  • 举报
回复
midp1.0不支持持声音,在nokia 必须调用本地api它的站上有示例代码,不过都失真,听说nokia是四和舷
artmouse 2004-09-07
  • 打赏
  • 举报
回复
这个问题我研究了好久,确实没什么好办法,以下观点只适用于noika40系列,midp1的机器

1,用nokia那个开发套间转换为数组播放
2,转换成ott文件格式,作为资源文件,读取后播放
3,播放单音调文件。

wav的播放,nokia上面写着是支持,但是据反编译了n多游戏,只有一个用了wav的,但是这个wav好像在程序中没有播放,是无用代码,猜想作者在那里也遇到困难了,所以我认为可能真的不支持wav的播放。

关于声音的转换
不管midi转换为数组还是ott格式,失真都非常大,就是对于单声道的midi也是这样。我找了n多midi最后转换为该格式都不能忍受,实在不行偷了别人游戏里面的声音,还过得去。
thunderxs 2004-09-06
  • 打赏
  • 举报
回复
不能播放
nik_Amis 2004-09-05
  • 打赏
  • 举报
回复
up
foxyou 2004-09-05
  • 打赏
  • 举报
回复
不可以的,换成数组或者wav吧
HashCodeWithJava 2004-09-05
  • 打赏
  • 举报
回复
没有办法的
ecaol 2004-07-05
  • 打赏
  • 举报
回复
up
qlampskyface 2004-07-01
  • 打赏
  • 举报
回复
i don't know,but up!

13,100

社区成员

发帖
与我相关
我的任务
社区描述
Java J2ME
社区管理员
  • J2ME社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧