我无法找到通过J2ME平台上的扬声器从阵列输出声音的简单代码(我知道Create Player类需要带参数的WAV头)。
int[] wav_hdr = {0x52,0x49,0x46,0x46,
0xC6,0x0F,0x00,0x00,
0x57,0x41,0x56,0x45,
0x66,0x6D,0x74,0x20,
0x12,0x00,0x00,0x00,
0x01,0x00,0x01,0x00,
0x40,0x1F,0x00,0x00,
0x40,0x1F,0x00,0x00,
0x01,0x00,0x08,0x00,
0x00,0x00,0x64,0x61,
0x74,0x61,0xA0,0x0F,
0x00,0x00};\\ wav header
byte[] adata = new byte[wav_hdr.length+4000];
for(int i=0; i<wav_hdr.length; i++) {
adata[i] = (byte)wav_hdr[i];
}
Player player = Manager.createPlayer(new ByteArrayInputStream(adata), "audio/x-wav");
player.start();