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