Skip to content

Commit 64023c0

Browse files
authored
Merge pull request #75 from WeibelLab/audio_record_fix
Fix for audio being recorded while unchecked
2 parents 3a3aedc + ae2b2d9 commit 64023c0

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

JS_Files/audio.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,15 @@ export class Audio {
394394
return this.#deviceId;
395395
}
396396

397+
/**
398+
* Getter function to retrieve the device recording status based on video and audio
399+
*
400+
* @return {string} - Device identifier used to describe device recording status
401+
*/
402+
getRecordStatus() {
403+
return (this.#audioCheckbox.checked);
404+
}
405+
397406
/**
398407
* Function used to stop the device from transmitting data/running
399408
*/

JS_Files/camera.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ export class Camera {
6565
return this.#kind;
6666
}
6767

68+
/**
69+
* Getter function to retrieve the device recording status based on video and audio
70+
*
71+
* @return {string} - Device identifier used to describe device recording status
72+
*/
73+
getRecordStatus() {
74+
return (this.#audioCheckbox.checked || this.#videoCheckbox.checked);
75+
}
76+
6877

6978
/**
7079
* Set width and height for the input of the camera feed.

JS_Files/chronosense.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,16 @@ async function recordAllSelectedDevices() {
480480
}
481481
})
482482
selectedDevices.forEach((device) => {
483+
// Checks whether or not Audio or Video is selected if not do not start
484+
if (device.getRecordStatus() == false) {
485+
console.log('Audio and Video are both off')
486+
}
487+
else {
483488
// Start recording
484489
device.setDirName(recordDirectory);
485490
device.startRecording();
486491
numRecording++;
492+
}
487493
});
488494
}
489495
else{

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ChronoSense",
3-
"version": "1.7.2",
3+
"version": "1.7.3",
44
"description": "Chronosense Electron Application",
55
"main": "main.js",
66
"scripts": {

0 commit comments

Comments
 (0)