style: run format:apply
This commit is contained in:
@@ -50,9 +50,11 @@ const cmd: Command = {
|
|||||||
const modes = TTSManager.get.getModules();
|
const modes = TTSManager.get.getModules();
|
||||||
|
|
||||||
const filtered: string[] = modes
|
const filtered: string[] = modes
|
||||||
.filter((mode) =>
|
.filter((mode) => {
|
||||||
mode.name.toLowerCase().startsWith(focused.value.toLowerCase())
|
return mode.name
|
||||||
)
|
? mode.name.toLowerCase().startsWith(focused.value.toLowerCase())
|
||||||
|
: undefined;
|
||||||
|
})
|
||||||
.map((mode) => mode.name)
|
.map((mode) => mode.name)
|
||||||
.slice(0, 25);
|
.slice(0, 25);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { TTSModule, TTSResponse } from "../tts";
|
import { TTSModule, TTSResponse } from '../tts';
|
||||||
|
|
||||||
import { VoicesManager, Communicate } from 'edge-tts-universal';
|
import { VoicesManager, Communicate } from 'edge-tts-universal';
|
||||||
|
|
||||||
class AzureTTS implements TTSModule {
|
class AzureTTS implements TTSModule {
|
||||||
private voices: Array<string> | undefined = undefined;
|
private voices: Array<string> | undefined = undefined;
|
||||||
|
|
||||||
public name: string = "Azure";
|
public name: string = 'Azure';
|
||||||
|
|
||||||
async getVoices(): Promise<Array<string> | undefined> {
|
async getVoices(): Promise<Array<string> | undefined> {
|
||||||
if (!this.voices) {
|
if (!this.voices) {
|
||||||
@@ -16,7 +16,7 @@ class AzureTTS implements TTSModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return this.voices;
|
return this.voices;
|
||||||
};
|
}
|
||||||
|
|
||||||
async generate(voice: string, text: string): Promise<TTSResponse> {
|
async generate(voice: string, text: string): Promise<TTSResponse> {
|
||||||
const comm = new Communicate(text, {
|
const comm = new Communicate(text, {
|
||||||
@@ -31,7 +31,7 @@ class AzureTTS implements TTSModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return { data: Buffer.concat(buffers) };
|
return { data: Buffer.concat(buffers) };
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new AzureTTS();
|
export default new AzureTTS();
|
||||||
|
|||||||
Reference in New Issue
Block a user