Another pass at basic moments

Adding diary, name of powers, name of moment type, and some supporting
thoughts.

Added a debug menu item to disable or enable the eleven labs speech.
Useful for removing it when debugging
This commit is contained in:
Tyler Marques 2025-05-29 16:20:17 -07:00
parent e1309c4012
commit ecf8e1db06
No known key found for this signature in database
GPG key ID: CB99EDCF41D3016F
7 changed files with 227 additions and 23 deletions

View file

@ -67,6 +67,11 @@ async function testElevenLabsKey() {
* @returns Promise that resolves when audio completes or rejects on error
*/
export async function speakSummary(summaryText: string): Promise<void> {
if (!config.speechEnabled) {
console.log("Speech disabled via config, skipping TTS");
return;
}
if (!summaryText || summaryText.trim() === '') {
console.warn("No summary text provided to speakSummary function");
return;
@ -98,12 +103,11 @@ export async function speakSummary(summaryText: string): Promise<void> {
try {
// Truncate text to first 100 characters for ElevenLabs
// FIXME: Is this meant to be truncated? Presumably not
//const textForSpeaking = textToSpeak.substring(0, 100);
let textForSpeaking;
if (config.isDebugMode) {
const textForSpeaking = textToSpeak.substring(0, 100);
textForSpeaking = textToSpeak.substring(0, 100);
} else {
const textForSpeaking = textToSpeak
textForSpeaking = textToSpeak
}
// Hit ElevenLabs TTS endpoint with the truncated text
const headers = {