feat: add canBeUsed to TTSModule
This commit is contained in:
@@ -32,6 +32,10 @@ class AzureTTS implements TTSModule {
|
|||||||
|
|
||||||
return { data: Buffer.concat(buffers) };
|
return { data: Buffer.concat(buffers) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async canBeUsed(): Promise<boolean> {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new AzureTTS();
|
export default new AzureTTS();
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ const ttsGoogle: TTSModule = {
|
|||||||
resolve({ error: 'timed out' });
|
resolve({ error: 'timed out' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async canBeUsed(): Promise<boolean> {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export interface TTSModule {
|
|||||||
name: string;
|
name: 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>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TTSManager {
|
export class TTSManager {
|
||||||
|
|||||||
Reference in New Issue
Block a user