Add lsvoices command
This commit is contained in:
@@ -37,6 +37,16 @@ export abstract class BaseEngine {
|
||||
return this.voices[voice] != null;
|
||||
}
|
||||
|
||||
/** Returns sorted lowercase voice names known to this engine. Empty if the engine accepts any voice. */
|
||||
listVoices(): string[] {
|
||||
return Object.keys(this.voices).sort();
|
||||
}
|
||||
|
||||
/** True when this engine has no static voice table and accepts any voice string. */
|
||||
isFreeformVoice(): boolean {
|
||||
return Object.keys(this.voices).length === 0;
|
||||
}
|
||||
|
||||
/** Default implementation: subclass should override either this or getSpeechFile. */
|
||||
async getSpeech(_text: string, _voice?: string, _params?: VoiceParams): Promise<Response> {
|
||||
throw new Error(`${this.shortName}: getSpeech not implemented`);
|
||||
|
||||
Reference in New Issue
Block a user