Added support for openai api tts.

This commit is contained in:
2025-04-05 14:40:56 +00:00
parent b8e2e6e238
commit e8eb93ae1b
11 changed files with 2063 additions and 989 deletions
+24
View File
@@ -9,6 +9,9 @@ export class TTSHandler {
// Set up event dispatcher
this.eventTarget = document.createElement('div');
// Module state tracking - conform to BaseModule interface
this.state = 'PENDING';
}
/**
@@ -77,6 +80,27 @@ export class TTSHandler {
return [];
}
/**
* Get the current module state
* @returns {string} - Current state
*/
getState() {
return this.state;
}
/**
* Change the module state
* @param {string} newState - The new state
*/
changeState(newState) {
this.state = newState;
// Dispatch state change event
this.dispatchEvent('state:changed', {
state: newState
});
}
/**
* Dispatch a custom event
* @param {string} eventName - Name of the event