beep boop beep boop

This commit is contained in:
core 2023-11-20 12:05:27 -05:00
parent f035b10f67
commit e47338485d
Signed by: core
GPG Key ID: FDBF740DADDCEECF
2 changed files with 10 additions and 4 deletions

View File

@ -210,6 +210,8 @@ else {
//VARS
//**********
const params = new URLSearchParams(window.location.search);
const selected = Number(params.get("v"));
var fpsOut = document.getElementById('boldStuff');
var transOutput = document.getElementById('myTrans'),
rotOutput = document.getElementById('myRot'),
@ -1223,7 +1225,7 @@ function drawAnalysisResults(emotionList, genderList, ageList, faces)
//displays gender, age and emotion data
canCon.translate(mWidth, 0);
canCon.scale(-1, 1);
drawGenderAgeEmotions(emotionList[i], genderList[i], ageList[i], i, activeMode);
drawGenderAgeEmotions(emotionList[i], genderList[i], ageList[i], i, activeMode,selected);
canCon.translate(mWidth, 0);
canCon.scale(-1, 1);
}

View File

@ -1044,8 +1044,9 @@ function beep(duration, frequency, volume, type, callback) {
* @param {int} age - estimated age
* @param {int} index - used by detector for multiple faces
* @param {int} mode - used to determine the operating mode
* @param {int} selected - which emotion is selected to go beep boop
*/
function drawGenderAgeEmotions(emotion_values,gender,age,index,mode)
function drawGenderAgeEmotions(emotion_values,gender,age,index,mode,selected)
{
if (mode === MODE_TRACK)
{
@ -1167,8 +1168,11 @@ function drawGenderAgeEmotions(emotion_values,gender,age,index,mode)
{
for(var j = 0; j < numberOfEmotions; ++j)
{
console.log(emotion_values[j]);
beep(100, 500 + 500 * emotion_values[j], 1, "sine", () => {});
if (j === selected) {
console.log(emotion_values[j]);
beep(300, 500 + 500 * emotion_values[j], 1, "sine", () => {
});
}
var length = emotion_values[j] * (backgroundWidth-emotionsBarOffset-xOffset*3);
canCon.beginPath();
canCon.fillStyle="black";