Skip to content

Commit

Permalink
remove calibration sounds and reset sample rate to 48k
Browse files Browse the repository at this point in the history
  • Loading branch information
sirdarckcat committed May 4, 2023
1 parent dc1812e commit effa8dd
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions binaural-recording/binaural-recording.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ onload = async function () {
echoCancellation: {exact: false},
latency: 0,
noiseSuppression: false,
sampleRate: 16000, // 48000
sampleRate: 48000,
sampleSize: 16,
deviceId: {
exact: audioDevice.deviceId
Expand Down Expand Up @@ -79,30 +79,6 @@ onload = async function () {
await new Promise(r=>setTimeout(r, 1e3));
mediaRecorder.start();
log("media recorder started");
const speakerMerger = audioContext.createChannelMerger(2);
const oscillatorLeft = new OscillatorNode(audioContext, {
type: "sine",
frequency: 7040,
});
const oscillatorRight = new OscillatorNode(audioContext, {
type: "sine",
frequency: 3520,
});
const oscillatorCenter = new OscillatorNode(audioContext, {
type: "sine",
frequency: 2093,
});
oscillatorLeft.connect(speakerMerger, 0, 0);
oscillatorRight.connect(speakerMerger, 0, 1);
oscillatorCenter.connect(audioContext.destination);
speakerMerger.connect(audioContext.destination);
const soundStart = audioContext.currentTime + 1;
oscillatorCenter.start(soundStart + 0.01);
oscillatorCenter.stop(soundStart + 0.02);
oscillatorLeft.start(soundStart + 1.01);
oscillatorLeft.stop(soundStart + 1.02);
oscillatorRight.start(soundStart + 2.01);
oscillatorRight.stop(soundStart + 2.02);
await new Promise(r=>setTimeout(r, 10e3));
mediaRecorder.stop();
log("media recorder stopped");
Expand Down

0 comments on commit effa8dd

Please sign in to comment.