多线程音乐合成的问题
midiOut.changeInstrument(),两个线程声音都有了,乐器设置不了。import win.util.lyric;
var lyric = win.util.lyric();
lyric.show();
//打开播放设备
import sys.midiOut;
var midiOut = sys.midiOut();
//打开一个线程
thread.invoke(function(midiOut,lyric){
midiOut.log=function(v){lyric.text=v;};
midiOut.changeInstrument(1,0)
midiOut.play("两只老虎, 1__,2__,3__,1__","C4"/* 1=C */,250/* ♩=120 */);
lyric.close();
},midiOut,lyric);
//添加一个线程
thread.invoke(function(midiOut){
midiOut.changeInstrument(115,5)
midiOut.play("1'__,3'__,1'__,3'__,1'__,3'__,1__,","C4"/* 1=C */,250/* ♩=120 */);
},midiOut);
win.loopMessage();
页:
[1]