feat: add default voices
This commit is contained in:
@@ -6,6 +6,7 @@ class AzureTTS implements TTSModule {
|
||||
private voices: Array<string> | undefined = undefined;
|
||||
|
||||
public name: string = 'Azure';
|
||||
public defaultVoice: string = 'en-US-AvaNeural';
|
||||
|
||||
async getVoices(): Promise<Array<string> | undefined> {
|
||||
if (!this.voices) {
|
||||
|
||||
@@ -9,6 +9,8 @@ const USER_AGENT =
|
||||
|
||||
const ttsGoogle: TTSModule = {
|
||||
name: 'Google',
|
||||
defaultVoice: 'en',
|
||||
|
||||
async getVoices(): Promise<string[]> { return GOOGLE_TTS_VOICES.voices },
|
||||
|
||||
async generate(voice: string, text: string): Promise<TTSResponse> {
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface TTSResponse {
|
||||
|
||||
export interface TTSModule {
|
||||
name: string;
|
||||
defaultVoice?: string;
|
||||
getVoices: () => Promise<Array<string> | undefined>;
|
||||
generate: (voice: string, text: string) => Promise<TTSResponse>;
|
||||
canBeUsed: () => Promise<boolean>;
|
||||
|
||||
Reference in New Issue
Block a user