improvement: voice sequences now play based on audio lengt

As opposed to set time. This will help account for discrepancies between audio cue lengths in different languages
This commit is contained in:
Youwen Wu 2024-02-27 00:10:18 -08:00
parent 0d77ea7f84
commit e18e1b3c91
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -29,26 +29,33 @@ export const initializationSequence = async () => {
Notifications.info("Jankboard initialized!", { Notifications.info("Jankboard initialized!", {
withAudio: true, withAudio: true,
src: getVoicePath("jankboard-initialized"), src: getVoicePath("jankboard-initialized"),
}); onComplete: () => {
setTimeout(() => { if (get(settingsStore).goWoke) {
if (get(settingsStore).goWoke) return; sequenceStore.update("initializationComplete", true);
periodicSequence();
return;
}
Notifications.success("LittenOS is online", { Notifications.success("LittenOS is online", {
withAudio: true, withAudio: true,
src: getVoicePath("littenos-is-online"), src: getVoicePath("littenos-is-online"),
}); onComplete: () => {
setTimeout(() => {
Notifications.warn("Breaching Monte Vista codebase", { Notifications.warn("Breaching Monte Vista codebase", {
withAudio: true, withAudio: true,
src: getVoicePath("breaching-monte-vista"), src: getVoicePath("breaching-monte-vista"),
}); onComplete: () => {
setTimeout(() => { Notifications.playAudio(
Notifications.playAudio(getVoicePath("hello-virtual-assistant"), () => { getVoicePath("hello-virtual-assistant"),
() => {
sequenceStore.update("initializationComplete", true); sequenceStore.update("initializationComplete", true);
periodicSequence(); periodicSequence();
}
);
},
});
},
});
},
}); });
}, 3000);
}, 3000);
}, 3000);
}; };
let counter = 1; let counter = 1;
@ -185,8 +192,9 @@ export const infotainmentBootupSequence = async () => {
get(sequenceStore).infotainmentStartedFirstTime || get(sequenceStore).infotainmentStartedFirstTime ||
get(settingsStore).disableAnnoyances || get(settingsStore).disableAnnoyances ||
infotainmentStarted infotainmentStarted
) ) {
return; return;
}
infotainmentStarted = true; infotainmentStarted = true;
await tick(); await tick();
@ -195,8 +203,7 @@ export const infotainmentBootupSequence = async () => {
Notifications.info("Infotainment system buffering", { Notifications.info("Infotainment system buffering", {
withAudio: true, withAudio: true,
src: getVoicePath("infotainment-system-buffering"), src: getVoicePath("infotainment-system-buffering"),
}); onComplete: () => {
setTimeout(() => {
Notifications.success("Infotainment system online", { Notifications.success("Infotainment system online", {
withAudio: true, withAudio: true,
src: getVoicePath("infotainment-system-online"), src: getVoicePath("infotainment-system-online"),
@ -204,7 +211,8 @@ export const infotainmentBootupSequence = async () => {
sequenceStore.update("infotainmentStartedFirstTime", true); sequenceStore.update("infotainmentStartedFirstTime", true);
}, },
}); });
}, 3000); },
});
}; };
if (!get(sequenceStore).initializationComplete) { if (!get(sequenceStore).initializationComplete) {