Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added auto-calibration #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dracolytch
Copy link

Tested on three devices, auto-calibration seems to work fairly well.

@jasper-lu
Copy link

@dracolytch
You have this line here :

if (cd.directionChanges <= cd.downThreshold) cd.maxVolumeRatio *= cd.downAmount;

Wouldn't this sort of continuously lower the maxVolumeRatio if there's no activity?

@dracolytch
Copy link
Author

Yes, to a point. If we can't hear anything, it's either because a) there's nothing to hear, or b) the setting is too high and we're not listening. So we reduce the ratio... But after a while we'll reduce into the point where background white noise will trigger direction changes, causing it to stop going down. If things are really quiet, or there's no motion, the worst-case is for the ratio to get just a bit lower than we'd ideally like, but where it still is responsive to the user. If the mic or speakers are off, it could get turned WAY down, so I believe I put in a min value check, so we never hit 0.

 On Tuesday, March 17, 2015 7:02 PM, Jasper Lu <notifications@github.com> wrote:

@dracolytch
You have this line here : if (cd.directionChanges <= cd.downThreshold) cd.maxVolumeRatio *= cd.downAmount;
Wouldn't this sort of continuously lower the maxVolumeRatio if there's no activity?—
Reply to this email directly or view it on GitHub.

@jasper-lu
Copy link

Ah. When would you stop calibrating/how would you know when it's at the
right calibration?

On Tue, Mar 17, 2015, 8:34 PM dracolytch notifications@github.com wrote:

Yes, to a point. If we can't hear anything, it's either because a) there's
nothing to hear, or b) the setting is too high and we're not listening. So
we reduce the ratio... But after a while we'll reduce into the point where
background white noise will trigger direction changes, causing it to stop
going down. If things are really quiet, or there's no motion, the
worst-case is for the ratio to get just a bit lower than we'd ideally like,
but where it still is responsive to the user. If the mic or speakers are
off, it could get turned WAY down, so I believe I put in a min value check,
so we never hit 0.

On Tuesday, March 17, 2015 7:02 PM, Jasper Lu notifications@github.com
wrote:

@dracolytch
You have this line here : if (cd.directionChanges <= cd.downThreshold)
cd.maxVolumeRatio *= cd.downAmount;
Wouldn't this sort of continuously lower the maxVolumeRatio if there's no
activity?—
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#9 (comment).

@dracolytch
Copy link
Author

I think it depends on the application. For my tests, I just left it on, since it would adjust as my environment adjusted, and it didn't seem to take up a lot of additional processing power. I did include the ability to turn off calibration to get those CPU cycles back, but without constant monitoring, you'll require some kind of interaction with the user to perform calibration ("Don't move for 5 seconds while we calibrate" kind of dialog), and then have to hope the environment (including computer speaker volume) doesn't change too much.

 On Tuesday, March 17, 2015 10:08 PM, Jasper Lu <notifications@github.com> wrote:

Ah. When would you stop calibrating/how would you know when it's at the
right calibration?

On Tue, Mar 17, 2015, 8:34 PM dracolytch notifications@github.com wrote:

Yes, to a point. If we can't hear anything, it's either because a) there's
nothing to hear, or b) the setting is too high and we're not listening. So
we reduce the ratio... But after a while we'll reduce into the point where
background white noise will trigger direction changes, causing it to stop
going down. If things are really quiet, or there's no motion, the
worst-case is for the ratio to get just a bit lower than we'd ideally like,
but where it still is responsive to the user. If the mic or speakers are
off, it could get turned WAY down, so I believe I put in a min value check,
so we never hit 0.

On Tuesday, March 17, 2015 7:02 PM, Jasper Lu notifications@github.com
wrote:

@dracolytch
You have this line here : if (cd.directionChanges <= cd.downThreshold)
cd.maxVolumeRatio *= cd.downAmount;
Wouldn't this sort of continuously lower the maxVolumeRatio if there's no
activity?—
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#9 (comment).


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants