我开始使用名为Tone.js的库创建一个应用程序,它允许我以各种方式在Web上操作音频。
目前,我想为耳机用户创建两个频道(左和右),并在每个耳中播放一个不同的频率(例如左边是400Hz,右边是500Hz)
根据我目前的代码,我有两个频率播放,每个人都在玩。有没有人对我如何分开它们有任何建议?
到目前为止,这是我的代码:
//create a synth and connect it to the master output (your speakers)
//Connect each separate tone to split
var split = new Tone.Split();
var leftEar = new Tone.Oscillator().toMaster();
var rightEar = new Tone.Oscillator().toMaster();
leftEar.frequency.value = 400;
rightEar.frequency.value = 500;
split.left = leftEar;
split.right = rightEar;
leftEar.connect(split);
rightEar.connect(split);
leftEar.start();
rightEar.start();
//Frequency is equivalent to difference between frequency in left and right ear
var frequency = {
"Gamma" : [30, 50],
"Beta" : [14, 30],
"Alpha" : [8, 14],
"Theta" : [4, 8],
"Delta" : [0.1, 4]
};
谢谢!
参考:https://tonejs.github.io/docs/#Split和https://github.com/Tonejs/Tone.js/wiki/Signals
答案 0 :(得分:3)
INSERT INTO odbc.`attendance` (`DATETIME`, `DATE`, `TIME`)
SELECT t.`DATETIME`, t.`DATE`, t.`TIME`
FROM `odbc`.`attendance_temp` t
LEFT JOIN `odbc`.`attendance` f
ON t.`DATETIME` = f.`DATETIME`
WHERE f.`DATETIME` IS NULL;
上呼叫.toMaster()
split
split.left = leftEar;
完成这些更改后,您的代码将如下所示:
leftEar.connect(split.left)