Added support for openai api tts.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user