Skip to content

Commit

Permalink
Merge pull request #307 from neopholus/fix-for-issue-#299
Browse files Browse the repository at this point in the history
Fix for issue #299
  • Loading branch information
Apollon77 committed May 25, 2024
2 parents 8effa93 + 46bd2d5 commit 089746c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/speech2device.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ class Speech2Device {
let count = 0;
let intervalHandler = setInterval(async () => {
count++;
if (count > 20) {
// We are checking every 500 ms, expected length of playback is defined in variable duration in seconds
// Thus, we have to count to duration*2 to be able to wait long enough for the expected playback duration.
// We add two additional seconds, to cover delays before the playback starts.
if (count > (duration+2)*2) {
clearInterval(intervalHandler);
intervalHandler = null;
this.adapter.log.error(`Error while checking if ${chromecastAnnouncementDev} finished playing announcement: ${announcementJSON}: TIMEOUT`);
Expand Down

0 comments on commit 089746c

Please sign in to comment.