Skip to content

Commit

Permalink
Merge pull request #75 from WeibelLab/audio_record_fix
Browse files Browse the repository at this point in the history
Fix for audio being recorded while unchecked
  • Loading branch information
stevenrick authored Jun 10, 2022
2 parents 3a3aedc + ae2b2d9 commit 64023c0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
9 changes: 9 additions & 0 deletions JS_Files/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,15 @@ export class Audio {
return this.#deviceId;
}

/**
* Getter function to retrieve the device recording status based on video and audio
*
* @return {string} - Device identifier used to describe device recording status
*/
getRecordStatus() {
return (this.#audioCheckbox.checked);
}

/**
* Function used to stop the device from transmitting data/running
*/
Expand Down
9 changes: 9 additions & 0 deletions JS_Files/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ export class Camera {
return this.#kind;
}

/**
* Getter function to retrieve the device recording status based on video and audio
*
* @return {string} - Device identifier used to describe device recording status
*/
getRecordStatus() {
return (this.#audioCheckbox.checked || this.#videoCheckbox.checked);
}


/**
* Set width and height for the input of the camera feed.
Expand Down
6 changes: 6 additions & 0 deletions JS_Files/chronosense.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,16 @@ async function recordAllSelectedDevices() {
}
})
selectedDevices.forEach((device) => {
// Checks whether or not Audio or Video is selected if not do not start
if (device.getRecordStatus() == false) {
console.log('Audio and Video are both off')
}
else {
// Start recording
device.setDirName(recordDirectory);
device.startRecording();
numRecording++;
}
});
}
else{
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ChronoSense",
"version": "1.7.2",
"version": "1.7.3",
"description": "Chronosense Electron Application",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 64023c0

Please sign in to comment.