tts-narrator
Version:
Generate narration with Text-To-Speech technology
30 lines (29 loc) • 1.62 kB
JavaScript
;
const oclif_utils_1 = require("@handy-common-utils/oclif-utils");
const core_1 = require("@oclif/core");
const script_processor_1 = require("./script-processor");
const script_processor_flags_1 = require("./script-processor-flags");
class TtsNarratorCli extends core_1.Command {
async run() {
const options = await (0, oclif_utils_1.withEnhancedFlagsHandled)(this, () => this.parse(TtsNarratorCli));
const { args, flags } = options;
const processor = new script_processor_1.ScriptProcessor(args.file, flags);
await processor.run((0, oclif_utils_1.reconstructCommandLine)(this, options));
}
}
TtsNarratorCli.id = ' '; // workaround for the correct USAGE section in help output
TtsNarratorCli.description = 'Generate narration with Text-To-Speech technology';
TtsNarratorCli.flags = Object.assign(Object.assign({}, oclif_utils_1.enhancedFlags), script_processor_flags_1.scriptProcessorFlags);
TtsNarratorCli.args = {
file: core_1.Args.string({
required: true,
description: 'path to the script file (.yml)',
}),
};
TtsNarratorCli.examples = [
'<%= config.bin %> myscript.yml --play --interactive --service azure --subscription-key-env TTS_SUBSCRIPTION_KEY --region australiaeast',
'<%= config.bin %> ./test/fixtures/script3.yml -s azure --ssml -r australiaeast --subscription-key-env=TTS_SUB_KEY --no-play --interactive -d',
'<%= config.bin %> ./test/fixtures/script3.yml -s azure -r australiaeast --subscription-key-env=TTS_SUB_KEY --quiet',
'<%= config.bin %> ./test/fixtures/script3.yml',
];
module.exports = TtsNarratorCli;