Checkpoint Eibenreith ink architecture
This commit is contained in:
@@ -517,17 +517,20 @@ export class BrowserTTSModule extends TTSHandlerModule {
|
||||
}
|
||||
|
||||
/**
|
||||
* Speak preloaded speech
|
||||
* Not applicable for the browser TTS (always returns false)
|
||||
* @param {Object} preloadData - Preloaded speech data
|
||||
* @param {Function} callback - Callback for when speech completes
|
||||
* @returns {boolean} - Success status (always false)
|
||||
* Speak preloaded speech metadata.
|
||||
* Browser TTS cannot preload audio bytes, so its preload result carries the
|
||||
* text and duration estimate and playback still happens through speak().
|
||||
*/
|
||||
speakPreloaded(preloadData, callback = null) {
|
||||
if (typeof callback === 'function') {
|
||||
callback({ success: false, reason: 'not_supported' });
|
||||
const text = String(preloadData?.text || '').trim();
|
||||
if (!text) {
|
||||
if (typeof callback === 'function') {
|
||||
callback({ success: false, reason: 'empty_preloaded_text' });
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
return this.speak(text, callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user