disable echo cancellation and noise suppression

master
Matthew Huntington 11 months ago
parent aa91e38726
commit da730ccf8f

Binary file not shown.

Binary file not shown.

@ -6,7 +6,14 @@ function startPitchDetection(callback) {
}
// Request access to the microphone
navigator.mediaDevices.getUserMedia({ audio: true })
//navigator.mediaDevices.getUserMedia({ audio: true })
navigator.mediaDevices.getUserMedia({
audio: {
echoCancellation: false,
noiseSuppression: false,
autoGainControl: false
}
})
.then(stream => {
// Create an audio context and an analyser node
const audioContext = new (window.AudioContext || window.webkitAudioContext)();

@ -76,7 +76,7 @@ maxInput.addEventListener('change', ()=>{
})
startPitchDetection((heardPitch)=>{
if(newTone) {
if(heardPitch !== -1 && newTone) {
const centsDifference = 1200 * Math.log2(heardPitch / newTone)
document.querySelector('#analyze-pitch input[type="range"]').value = centsDifference
}

Loading…
Cancel
Save