tts-narrator
Version:
Generate narration with Text-To-Speech technology
25 lines (24 loc) • 2.09 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.scriptProcessorFlags = void 0;
const core_1 = require("@oclif/core");
const tts_service_1 = require("./tts-service");
/**
* CLI flags that are required/used by the ScriptProcessor.
*/
exports.scriptProcessorFlags = {
debug: core_1.Flags.boolean({ char: 'd', description: 'output debug information' }),
quiet: core_1.Flags.boolean({ char: 'q', description: 'output warn and error information only' }),
service: core_1.Flags.string({ char: 's', options: Object.entries(tts_service_1.TtsServiceType).map(([_name, value]) => value), description: 'text-to-speech service to use' }),
'subscription-key': core_1.Flags.string({ char: 'k', description: 'Azure Speech service subscription key' }),
'subscription-key-env': core_1.Flags.string({ description: 'Name of the environment variable that holds the subscription key' }),
region: core_1.Flags.string({ char: 'r', description: 'Region of the text-to-speech service' }),
outputFormat: core_1.Flags.integer({ char: 'f', default: 3, description: 'Output format for audio' }), // https://learn.microsoft.com/en-us/javascript/api/microsoft-cognitiveservices-speech-sdk/speechsynthesisoutputformat
play: core_1.Flags.boolean({ char: 'p', default: true, allowNo: true, description: 'play generated audio' }),
interactive: core_1.Flags.boolean({ char: 'i', default: false, description: 'wait for key press before entering each section' }),
overwrite: core_1.Flags.boolean({ char: 'o', default: false, description: 'always overwrite previously generated audio files' }),
'dry-run': core_1.Flags.boolean({ default: false, description: 'don\'t try to generate or play audio' }),
ssml: core_1.Flags.boolean({ default: false, exclusive: ['quiet'], description: 'display generated SSML' }),
chapters: core_1.Flags.string({ description: 'list of chapters to process, examples: "1-10,13,15", "4-"' }),
sections: core_1.Flags.string({ description: 'list of sections to process, examples: "1-10,13,15", "5-"' }),
};