Fix undefined variable when naming recording file
authorCédric Godin <cedric.godin@usherbrooke.ca>
Tue, 11 Jun 2019 18:53:44 +0000 (14:53 -0400)
committerCédric Godin <cedric.godin@usherbrooke.ca>
Tue, 11 Jun 2019 18:53:44 +0000 (14:53 -0400)
audio-recorder.js

index babd1d89adea0911d8bfc684f620d1f05690a230..6fd7ae37f7c77a7ba71ecae425705334d9aeb064 100644 (file)
@@ -111,20 +111,20 @@ exports.AudioRecorder =  class AudioRecorder extends EventEmitter {
             console.log(`Recorder ${this.index} started`)
             console.log(`Recorder ${this.index} was ${this.active} active`)
 
-            now = new Date()
+            let now = new Date()
 
-            dateString = ""
+            let dateString = ""
             dateString += now.getFullYear() + "-"
             dateString += (now.getMonth()+1) + "-"
             dateString += now.getDate()
 
-            timeString = ""
+            let timeString = ""
             timeString += now.getHours() + "-"
             timeString += now.getMinutes() + "-"
             timeString += now.getSeconds() + "-"
             timeString += now.getMilliseconds()
 
-            datetimeString = dateString + "_" + timeString
+            let datetimeString = dateString + "_" + timeString
 
             let filename = path.join(this.workspacePath, `ODAS_${id}_${datetimeString}_${this.suffix}.wav`)
             this.path = filename