From 244a6f548faaca641737150aeda3253dc631123f Mon Sep 17 00:00:00 2001 From: musicw Date: Thu, 11 Aug 2016 21:47:34 -0400 Subject: [PATCH 1/2] fix syntax err in docs example --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 393b992..d281e32 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ var detector = new PitchDetector({ // We can interpolate (very hacky) by looking at neighbours of the best // auto-correlation period and shifting the frequency a bit towards the // highest neighbour. - interpolateFrequency: true // default: true + interpolateFrequency: true, // default: true // Callback on pitch detection (Optional) onDetect: function(stats, pitchDetector) { @@ -81,10 +81,10 @@ var detector = new PitchDetector({ // at the same time! // Signal Normalization (Optional) - normalize: "rms" // or "peak". default: undefined + normalize: "rms", // or "peak". default: undefined // Only detect pitch once: (Optional) - stopAfterDetection: false + stopAfterDetection: false, // Buffer length (Optional) length: 1024, // default 1024 @@ -97,10 +97,10 @@ var detector = new PitchDetector({ maxFrequency: 20000, minPeriod: 2, // by period (i.e. actual distance of calculation in audio buffer) - maxPeriod: 512 // --> convert to frequency: frequency = sampleRate / period + maxPeriod: 512, // --> convert to frequency: frequency = sampleRate / period // Start right away - start: true // default: false + start: true, // default: false }) ``` From 347a0d589417c8b48d328d276c74e837841b4ca9 Mon Sep 17 00:00:00 2001 From: musicw Date: Thu, 11 Aug 2016 22:04:51 -0400 Subject: [PATCH 2/2] fix chrome err with mic input TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The value provided is neither an array, nor does it have indexed properties. Tried changing optional `[]` to optional `{}` and didn't work, so deleted line instead Firefox seems to continue to work --- pitchdetector.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pitchdetector.js b/pitchdetector.js index 87e48db..eb6d517 100644 --- a/pitchdetector.js +++ b/pitchdetector.js @@ -59,7 +59,6 @@ function getLiveInput(context,callback){ "googNoiseSuppression": "false", "googHighpassFilter": "false" }, - "optional": [] }, }, function(stream){ var liveInputNode = context.createMediaStreamSource(stream); @@ -533,4 +532,4 @@ if(typeof module !== 'undefined') { } else { window.PitchDetector = PitchDetector; } -})(); \ No newline at end of file +})();