tts-narrator
Advanced tools
Comparing version 1.0.17 to 1.1.0
@@ -5,8 +5,7 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
/* eslint-disable brace-style */ | ||
/* eslint-disable max-statements-per-line */ | ||
const stream = (0, tslib_1.__importStar)(require("stream")); | ||
const promise_utils_1 = require("@handy-common-utils/promise-utils"); | ||
const AV = (0, tslib_1.__importStar)(require("av")); | ||
const AV = tslib_1.__importStar(require("av")); | ||
require("mp3"); | ||
const promises_1 = tslib_1.__importDefault(require("node:fs/promises")); | ||
const stream = tslib_1.__importStar(require("node:stream")); | ||
function toBuffer(arr) { | ||
@@ -40,5 +39,7 @@ return ArrayBuffer.isView(arr) ? | ||
} | ||
const fileContent = await promises_1.default.readFile(filePath); | ||
return new Promise((resolve, reject) => { | ||
try { | ||
const asset = AV.Asset.fromFile(filePath); | ||
// eslint-disable-next-line import/namespace | ||
const asset = AV.Asset.fromBuffer(fileContent); | ||
asset.decodeToBuffer(buffer => { | ||
@@ -68,4 +69,6 @@ // Initiate the source | ||
exports.playMp3File = playMp3File; | ||
function getAudioFileDuration(filePath) { | ||
const asset = AV.Asset.fromFile(filePath); | ||
async function getAudioFileDuration(filePath) { | ||
const fileContent = await promises_1.default.readFile(filePath); | ||
// eslint-disable-next-line import/namespace | ||
const asset = AV.Asset.fromBuffer(fileContent); | ||
return (0, promise_utils_1.timeoutReject)(new Promise((resolve, reject) => { | ||
@@ -80,4 +83,4 @@ try { | ||
} | ||
}), 20000, new Error(`Unabled to determine audio duration, is the file '${filePath}' corrupted?`)); | ||
}), 20000, new Error(`Unable to determine audio duration, is the file '${filePath}' corrupted?`)); | ||
} | ||
exports.getAudioFileDuration = getAudioFileDuration; |
@@ -1,33 +0,30 @@ | ||
import { Command, flags } from '@oclif/command'; | ||
import { CommandOptions } from '@handy-common-utils/oclif-utils'; | ||
import { Command } from '@oclif/core'; | ||
declare class TtsNarratorCli extends Command { | ||
static Options: CommandOptions<typeof TtsNarratorCli>; | ||
static id: string; | ||
static description: string; | ||
static flags: { | ||
version: import("@oclif/parser/lib/flags").IBooleanFlag<void>; | ||
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>; | ||
'update-readme.md': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
debug: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
quiet: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
service: flags.IOptionFlag<string | undefined>; | ||
'subscription-key': flags.IOptionFlag<string | undefined>; | ||
'subscription-key-env': flags.IOptionFlag<string | undefined>; | ||
region: flags.IOptionFlag<string | undefined>; | ||
play: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
interactive: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
overwrite: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
'dry-run': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
ssml: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
chapters: flags.IOptionFlag<string | undefined>; | ||
sections: flags.IOptionFlag<string | undefined>; | ||
debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
service: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
'subscription-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
'subscription-key-env': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
region: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
play: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
interactive: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
overwrite: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
ssml: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
chapters: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
sections: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
help: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
version: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
'update-readme.md': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
}; | ||
static args: { | ||
name: "file"; | ||
description: string; | ||
}[]; | ||
file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>; | ||
}; | ||
static examples: string[]; | ||
protected init(): Promise<any>; | ||
run(argv?: string[]): Promise<void>; | ||
run(): Promise<void>; | ||
} | ||
export = TtsNarratorCli; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
const command_1 = require("@oclif/command"); | ||
const oclif_utils_1 = require("@handy-common-utils/oclif-utils"); | ||
const core_1 = require("@oclif/core"); | ||
const script_processor_1 = require("./script-processor"); | ||
class TtsNarratorCli extends command_1.Command { | ||
async init() { | ||
oclif_utils_1.OclifUtils.prependCliToExamples(this); | ||
return super.init(); | ||
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)); | ||
} | ||
async run(argv) { | ||
const options = this.parse(TtsNarratorCli, argv); | ||
if (options.flags['update-readme.md']) { | ||
oclif_utils_1.OclifUtils.injectHelpTextIntoReadmeMd(this); | ||
return; | ||
} | ||
const processor = new script_processor_1.ScriptProcessor(options.args.file, options.flags); | ||
await processor.run(oclif_utils_1.OclifUtils.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 = { | ||
...script_processor_1.scriptProcessorFlags, | ||
version: command_1.flags.version({ char: 'v' }), | ||
help: command_1.flags.help({ char: 'h' }), | ||
'update-readme.md': command_1.flags.boolean({ hidden: true, description: 'For developers only, don\'t use' }), | ||
TtsNarratorCli.flags = Object.assign(Object.assign({}, oclif_utils_1.enhancedFlags), script_processor_1.scriptProcessorFlags); | ||
TtsNarratorCli.args = { | ||
file: core_1.Args.string({ | ||
required: true, | ||
description: 'path to the script file (.yml)', | ||
}), | ||
}; | ||
TtsNarratorCli.args = [{ name: 'file', description: 'path to the script file (.yml)' }]; | ||
TtsNarratorCli.examples = [ | ||
'^ myscript.yml --play --interactive --service azure --subscription-key-env SUBSCRIPTION_KEY --region australiaeast', | ||
'^ ./test/fixtures/script3.yml -s azure --ssml -r australiaeast --subscription-key-env=TTS_SUB_KEY --no-play --interactive -d', | ||
'^ ./test/fixtures/script3.yml -s azure -r australiaeast --subscription-key-env=TTS_SUB_KEY --quiet', | ||
'^ ./test/fixtures/script3.yml', | ||
'<%= config.bin %> myscript.yml --play --interactive --service azure --subscription-key-env 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; |
@@ -6,8 +6,8 @@ "use strict"; | ||
/* eslint-disable no-use-before-define */ | ||
const util_1 = require("util"); | ||
const fs = (0, tslib_1.__importStar)(require("fs")); | ||
const js_yaml_1 = require("js-yaml"); | ||
const lodash_1 = require("lodash"); | ||
const readFileAsPromise = (0, util_1.promisify)(fs.readFile); | ||
const writeFileAsPromise = (0, util_1.promisify)(fs.writeFile); | ||
const fs = tslib_1.__importStar(require("node:fs")); | ||
const node_util_1 = require("node:util"); | ||
const readFileAsPromise = (0, node_util_1.promisify)(fs.readFile); | ||
const writeFileAsPromise = (0, node_util_1.promisify)(fs.writeFile); | ||
class NarrationParagraph { | ||
@@ -22,3 +22,3 @@ constructor(paragraph, index, section, chapter, script) { | ||
get settings() { | ||
return ({ ...this.section.settings, ...this.paragraph.settings }); | ||
return (Object.assign(Object.assign({}, this.section.settings), this.paragraph.settings)); | ||
} | ||
@@ -43,3 +43,3 @@ get key() { | ||
get settings() { | ||
return ({ ...this.chapter.settings, ...this.section.settings }); | ||
return (Object.assign(Object.assign({}, this.chapter.settings), this.section.settings)); | ||
} | ||
@@ -61,3 +61,3 @@ get key() { | ||
var _a; | ||
return ({ ...(_a = this.script.settings) === null || _a === void 0 ? void 0 : _a.voice, ...this.chapter.settings }); | ||
return (Object.assign(Object.assign({}, (_a = this.script.settings) === null || _a === void 0 ? void 0 : _a.voice), this.chapter.settings)); | ||
} | ||
@@ -64,0 +64,0 @@ get key() { |
@@ -1,3 +0,3 @@ | ||
import { flags } from '@oclif/command'; | ||
import { DefaultCliConsole, Flags } from '@handy-common-utils/oclif-utils'; | ||
import { ConsoleLineLogger } from '@handy-common-utils/misc-utils'; | ||
import { CommandOptions } from '@handy-common-utils/oclif-utils'; | ||
import { MultiRange } from 'multi-integer-range'; | ||
@@ -13,20 +13,22 @@ import { NarrationParagraph, NarrationScript } from './narration-script'; | ||
export declare const scriptProcessorFlags: { | ||
debug: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
quiet: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
service: flags.IOptionFlag<string | undefined>; | ||
'subscription-key': flags.IOptionFlag<string | undefined>; | ||
'subscription-key-env': flags.IOptionFlag<string | undefined>; | ||
region: flags.IOptionFlag<string | undefined>; | ||
play: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
interactive: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
overwrite: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
'dry-run': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
ssml: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
chapters: flags.IOptionFlag<string | undefined>; | ||
sections: flags.IOptionFlag<string | undefined>; | ||
debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
service: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
'subscription-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
'subscription-key-env': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
region: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
play: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
interactive: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
overwrite: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
ssml: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; | ||
chapters: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
sections: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>; | ||
}; | ||
export declare class ScriptProcessor { | ||
protected scriptFilePath: string; | ||
protected flags: Flags<typeof scriptProcessorFlags>; | ||
protected cliConsole: DefaultCliConsole; | ||
protected flags: CommandOptions<{ | ||
flags: typeof scriptProcessorFlags; | ||
}>['flags']; | ||
protected cliConsole: ConsoleLineLogger; | ||
protected ttsService: TtsService; | ||
@@ -37,3 +39,5 @@ protected audioGenerationOptions: AudioGenerationOptions | undefined; | ||
protected sectionRange: MultiRange | undefined; | ||
constructor(scriptFilePath: string, flags: Flags<typeof scriptProcessorFlags>, cliConsole?: DefaultCliConsole); | ||
constructor(scriptFilePath: string, flags: CommandOptions<{ | ||
flags: typeof scriptProcessorFlags; | ||
}>['flags'], cliConsole?: ConsoleLineLogger); | ||
protected hash(ssml: string, _paragraph: NarrationParagraph): string; | ||
@@ -40,0 +44,0 @@ protected loadScript(): Promise<void>; |
@@ -9,18 +9,18 @@ "use strict"; | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
/* eslint-disable no-console */ | ||
const fs = (0, tslib_1.__importStar)(require("fs")); | ||
const path_1 = (0, tslib_1.__importDefault)(require("path")); | ||
const murmurhash = (0, tslib_1.__importStar)(require("murmurhash")); | ||
const prompts_1 = (0, tslib_1.__importDefault)(require("prompts")); | ||
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk")); | ||
const command_1 = require("@oclif/command"); | ||
const oclif_utils_1 = require("@handy-common-utils/oclif-utils"); | ||
const misc_utils_1 = require("@handy-common-utils/misc-utils"); | ||
const core_1 = require("@oclif/core"); | ||
const chalk_1 = tslib_1.__importDefault(require("chalk")); | ||
const multi_integer_range_1 = require("multi-integer-range"); | ||
const murmurhash = tslib_1.__importStar(require("murmurhash")); | ||
const fs = tslib_1.__importStar(require("node:fs")); | ||
const node_path_1 = tslib_1.__importDefault(require("node:path")); | ||
// eslint-disable-next-line import/no-named-as-default | ||
const prompts_1 = tslib_1.__importDefault(require("prompts")); | ||
const audio_utils_1 = require("./audio-utils"); | ||
const azure_tts_service_1 = require("./azure-tts-service"); | ||
const narration_script_1 = require("./narration-script"); | ||
const audio_utils_1 = require("./audio-utils"); | ||
var TtsServiceType; | ||
(function (TtsServiceType) { | ||
TtsServiceType["Azure"] = "azure"; | ||
})(TtsServiceType = exports.TtsServiceType || (exports.TtsServiceType = {})); | ||
})(TtsServiceType || (exports.TtsServiceType = TtsServiceType = {})); | ||
/** | ||
@@ -30,15 +30,15 @@ * CLI flags that are required/used by the ScriptProcessor. | ||
exports.scriptProcessorFlags = { | ||
debug: command_1.flags.boolean({ char: 'd', description: 'output debug information' }), | ||
quiet: command_1.flags.boolean({ char: 'q', description: 'output warn and error information only' }), | ||
service: command_1.flags.string({ char: 's', options: Object.entries(TtsServiceType).map(([_name, value]) => value), description: 'text-to-speech service to use' }), | ||
'subscription-key': command_1.flags.string({ char: 'k', description: 'Azure Speech service subscription key' }), | ||
'subscription-key-env': command_1.flags.string({ description: 'Name of the environment variable that holds the subscription key' }), | ||
region: command_1.flags.string({ char: 'r', description: 'region of the text-to-speech service' }), | ||
play: command_1.flags.boolean({ char: 'p', default: true, allowNo: true, description: 'play generated audio' }), | ||
interactive: command_1.flags.boolean({ char: 'i', default: false, description: 'wait for key press before entering each section' }), | ||
overwrite: command_1.flags.boolean({ char: 'o', default: false, description: 'always overwrite previously generated audio files' }), | ||
'dry-run': command_1.flags.boolean({ default: false, description: 'don\'t try to generate or play audio' }), | ||
ssml: command_1.flags.boolean({ default: false, exclusive: ['quiet'], description: 'display generated SSML' }), | ||
chapters: command_1.flags.string({ description: 'list of chapters to process, examples: "1-10,13,15", "4-"' }), | ||
sections: command_1.flags.string({ description: 'list of sections to process, examples: "1-10,13,15", "5-"' }), | ||
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(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' }), | ||
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-"' }), | ||
}; | ||
@@ -49,3 +49,3 @@ class ScriptProcessor { | ||
this.flags = flags; | ||
this.cliConsole = cliConsole !== null && cliConsole !== void 0 ? cliConsole : (0, oclif_utils_1.cliConsoleWithColour)(this.flags, chalk_1.default); | ||
this.cliConsole = cliConsole !== null && cliConsole !== void 0 ? cliConsole : (0, misc_utils_1.consoleWithColour)(this.flags, chalk_1.default); | ||
} | ||
@@ -85,3 +85,3 @@ hash(ssml, _paragraph) { | ||
switch (ttsServiceType) { | ||
case TtsServiceType.Azure: | ||
case TtsServiceType.Azure: { | ||
this.ttsService = new azure_tts_service_1.AzureTtsService(); | ||
@@ -93,4 +93,6 @@ this.audioGenerationOptions = { | ||
break; | ||
default: | ||
} | ||
default: { | ||
throw new Error(`Unknown TTS service: ${ttsServiceType}`); | ||
} | ||
} | ||
@@ -104,3 +106,3 @@ } | ||
} | ||
const audioFilePath = path_1.default.join(audioFileFolder, `${ssmlHash}.mp3`); | ||
const audioFilePath = node_path_1.default.join(audioFileFolder, `${ssmlHash}.mp3`); | ||
return audioFilePath; | ||
@@ -166,3 +168,3 @@ } | ||
// check to see if the .mp3 file already exists | ||
if (!this.flags.overwrite && fs.existsSync(generatedAudioFilePath)) { | ||
if (!this.flags.overwrite && fs.existsSync(generatedAudioFilePath) && fs.statSync(generatedAudioFilePath).size > 0) { | ||
this.cliConsole.debug(`Re-using already existing audio file '${generatedAudioFilePath}' for ${chapterIndex}-${sectionIndex}-${paragraphIndex}`); | ||
@@ -172,6 +174,3 @@ } | ||
// generate .mp3 file if needed | ||
await this.ttsService.generateAudio(ssml, { | ||
...this.audioGenerationOptions, | ||
outputFilePath: generatedAudioFilePath, | ||
}); | ||
await this.ttsService.generateAudio(ssml, Object.assign(Object.assign({}, this.audioGenerationOptions), { outputFilePath: generatedAudioFilePath })); | ||
const audioDuration = await (0, audio_utils_1.getAudioFileDuration)(generatedAudioFilePath); | ||
@@ -178,0 +177,0 @@ this.cliConsole.debug(`Generated audio of ${audioDuration / 1000}s: ${generatedAudioFilePath}`); |
@@ -12,5 +12,5 @@ "use strict"; | ||
validateXML(xml, lineOffset) { | ||
const validatioinResult = (0, fast_xml_parser_1.validate)(xml); | ||
if (validatioinResult !== true) { | ||
const err = validatioinResult.err; | ||
const validationResult = fast_xml_parser_1.XMLValidator.validate(xml); | ||
if (validationResult !== true) { | ||
const err = validationResult.err; | ||
throw new Error(`Invalid markup at line ${err.line - lineOffset}. ${err.code}: ${err.msg}`); | ||
@@ -17,0 +17,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./narration-script"), exports); | ||
(0, tslib_1.__exportStar)(require("./audio-utils"), exports); | ||
(0, tslib_1.__exportStar)(require("./tts-service"), exports); | ||
(0, tslib_1.__exportStar)(require("./azure-tts-service"), exports); | ||
(0, tslib_1.__exportStar)(require("./script-processor"), exports); | ||
tslib_1.__exportStar(require("./narration-script"), exports); | ||
tslib_1.__exportStar(require("./audio-utils"), exports); | ||
tslib_1.__exportStar(require("./tts-service"), exports); | ||
tslib_1.__exportStar(require("./azure-tts-service"), exports); | ||
tslib_1.__exportStar(require("./script-processor"), exports); |
{ | ||
"name": "tts-narrator", | ||
"version": "1.0.17", | ||
"version": "1.1.0", | ||
"description": "Generate narration with Text-To-Speech technology", | ||
@@ -17,31 +17,26 @@ "main": "dist/types.js", | ||
"devDependencies": { | ||
"@handy-common-utils/dev-dependencies": "^1.0.20", | ||
"@oclif/dev-cli": "^1.26.0", | ||
"@oclif/test": "^1.2.8", | ||
"@types/av": "^0.4.1", | ||
"@types/js-yaml": "^4.0.3", | ||
"@types/lodash": "^4.14.172", | ||
"@types/prompts": "^2.0.14", | ||
"speaker": "^0.5.3", | ||
"typedoc-plugin-remove-references": "^0.0.5" | ||
"@handy-common-utils/dev-dependencies-mocha": "^1.5.4", | ||
"@oclif/test": "^3.2.13", | ||
"@types/av": "^0.4.4", | ||
"@types/js-yaml": "^4.0.9", | ||
"@types/lodash": "^4.14.202", | ||
"@types/prompts": "^2.4.9", | ||
"oclif": "^4.10.5", | ||
"speaker": "^0.5.4" | ||
}, | ||
"dependencies": { | ||
"@handy-common-utils/oclif-utils": "^1.0.7", | ||
"@handy-common-utils/promise-utils": "^1.1.1", | ||
"@oclif/command": "^1.8.0", | ||
"@oclif/config": "^1.17.0", | ||
"@oclif/plugin-help": "^3.2.3", | ||
"@handy-common-utils/misc-utils": "^1.5.2", | ||
"@handy-common-utils/oclif-utils": "^2.1.0", | ||
"av": "^0.4.9", | ||
"chalk": "^4.1.2", | ||
"fast-xml-parser": "^3.19.0", | ||
"fast-xml-parser": "^4.3.5", | ||
"js-yaml": "^4.1.0", | ||
"lodash": "^4.17.21", | ||
"microsoft-cognitiveservices-speech-sdk": "^1.18.1", | ||
"microsoft-cognitiveservices-speech-sdk": "^1.36.0", | ||
"mp3": "^0.1.0", | ||
"multi-integer-range": "^4.0.9", | ||
"murmurhash": "^2.0.0", | ||
"prompts": "^2.4.1" | ||
"multi-integer-range": "^5.2.0", | ||
"murmurhash": "^2.0.1", | ||
"prompts": "^2.4.2" | ||
}, | ||
"files": [ | ||
"package.json", | ||
"bin", | ||
@@ -48,0 +43,0 @@ "dist" |
1481
README.md
@@ -40,3 +40,5 @@ # tts-narrator | ||
USAGE | ||
$ tts-narrator [FILE] | ||
$ tts-narrator FILE[-h] [-v] [-d] [-s azure] [-k <value>] | ||
[--subscription-key-env <value>] [-r <value>] [-p] [-i] [-o] [--dry-run] | ||
[--ssml | -q] [--chapters <value>] [--sections <value>] | ||
@@ -46,49 +48,36 @@ ARGUMENTS | ||
OPTIONS | ||
-d, --debug output debug information | ||
-h, --help show CLI help | ||
FLAGS | ||
-d, --debug output debug information | ||
-h, --help Show help | ||
-i, --interactive wait for key press before entering each | ||
section | ||
-k, --subscription-key=<value> Azure Speech service subscription key | ||
-o, --overwrite always overwrite previously generated | ||
audio files | ||
-p, --[no-]play play generated audio | ||
-q, --quiet output warn and error information only | ||
-r, --region=<value> region of the text-to-speech service | ||
-s, --service=<option> text-to-speech service to use | ||
<options: azure> | ||
-v, --version Show CLI version | ||
--chapters=<value> list of chapters to process, examples: | ||
"1-10,13,15", "4-" | ||
--dry-run don't try to generate or play audio | ||
--sections=<value> list of sections to process, examples: | ||
"1-10,13,15", "5-" | ||
--ssml display generated SSML | ||
--subscription-key-env=<value> Name of the environment variable that | ||
holds the subscription key | ||
-i, --interactive wait for key press before | ||
entering each section | ||
DESCRIPTION | ||
Generate narration with Text-To-Speech technology | ||
-k, --subscription-key=subscription-key Azure Speech service subscription | ||
key | ||
EXAMPLES | ||
$ tts-narrator myscript.yml --play --interactive --service azure --subscription-key-env SUBSCRIPTION_KEY --region australiaeast | ||
-o, --overwrite always overwrite previously | ||
generated audio files | ||
$ tts-narrator ./test/fixtures/script3.yml -s azure --ssml -r australiaeast --subscription-key-env=TTS_SUB_KEY --no-play --interactive -d | ||
-p, --[no-]play play generated audio | ||
$ tts-narrator ./test/fixtures/script3.yml -s azure -r australiaeast --subscription-key-env=TTS_SUB_KEY --quiet | ||
-q, --quiet output warn and error information | ||
only | ||
-r, --region=region region of the text-to-speech | ||
service | ||
-s, --service=azure text-to-speech service to use | ||
-v, --version show CLI version | ||
--chapters=chapters list of chapters to process, | ||
examples: "1-10,13,15", "4-" | ||
--dry-run don't try to generate or play | ||
audio | ||
--sections=sections list of sections to process, | ||
examples: "1-10,13,15", "5-" | ||
--ssml display generated SSML | ||
--subscription-key-env=subscription-key-env Name of the environment variable | ||
that holds the subscription key | ||
EXAMPLES | ||
tts-narrator myscript.yml --play --interactive --service azure | ||
--subscription-key-env SUBSCRIPTION_KEY --region australiaeast | ||
tts-narrator ./test/fixtures/script3.yml -s azure --ssml -r australiaeast | ||
--subscription-key-env=TTS_SUB_KEY --no-play --interactive -d | ||
tts-narrator ./test/fixtures/script3.yml -s azure -r australiaeast | ||
--subscription-key-env=TTS_SUB_KEY --quiet | ||
tts-narrator ./test/fixtures/script3.yml | ||
$ tts-narrator ./test/fixtures/script3.yml | ||
``` | ||
@@ -103,179 +92,29 @@ | ||
tts-narrator | ||
## tts-narrator | ||
### Table of contents | ||
### Modules | ||
#### Namespaces | ||
- [audio-utils](#modulesaudio_utilsmd) | ||
- [azure-tts-service](#modulesazure_tts_servicemd) | ||
- [index](#modulesindexmd) | ||
- [narration-script](#modulesnarration_scriptmd) | ||
- [script-processor](#modulesscript_processormd) | ||
- [tts-service](#modulestts_servicemd) | ||
- [types](#modulestypesmd) | ||
- [NarrationScriptFile](#modulesnarrationscriptfilemd) | ||
#### Enumerations | ||
- [TtsServiceType](#enumsttsservicetypemd) | ||
#### Classes | ||
- [AzureTtsService](#classesazurettsservicemd) | ||
- [BaseTtsService](#classesbasettsservicemd) | ||
- [NarrationChapter](#classesnarrationchaptermd) | ||
- [NarrationParagraph](#classesnarrationparagraphmd) | ||
- [NarrationScript](#classesnarrationscriptmd) | ||
- [NarrationSection](#classesnarrationsectionmd) | ||
- [ScriptProcessor](#classesscriptprocessormd) | ||
#### Interfaces | ||
- [AudioGenerationOptions](#interfacesaudiogenerationoptionsmd) | ||
- [AzureAudioGenerationOptions](#interfacesazureaudiogenerationoptionsmd) | ||
- [ScriptSettings](#interfacesscriptsettingsmd) | ||
- [TtsService](#interfacesttsservicemd) | ||
- [VoiceSettings](#interfacesvoicesettingsmd) | ||
#### Variables | ||
- [scriptProcessorFlags](#scriptprocessorflags) | ||
#### Functions | ||
- [getAudioFileDuration](#getaudiofileduration) | ||
- [loadScript](#loadscript) | ||
- [playMp3File](#playmp3file) | ||
- [saveScript](#savescript) | ||
### Variables | ||
#### scriptProcessorFlags | ||
• `Const` **scriptProcessorFlags**: `Object` | ||
CLI flags that are required/used by the ScriptProcessor. | ||
##### Type declaration | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `chapters` | `IOptionFlag`<`undefined` \| `string`\> | | ||
| `debug` | `IBooleanFlag`<`boolean`\> | | ||
| `dry-run` | `IBooleanFlag`<`boolean`\> | | ||
| `interactive` | `IBooleanFlag`<`boolean`\> | | ||
| `overwrite` | `IBooleanFlag`<`boolean`\> | | ||
| `play` | `IBooleanFlag`<`boolean`\> | | ||
| `quiet` | `IBooleanFlag`<`boolean`\> | | ||
| `region` | `IOptionFlag`<`undefined` \| `string`\> | | ||
| `sections` | `IOptionFlag`<`undefined` \| `string`\> | | ||
| `service` | `IOptionFlag`<`undefined` \| `string`\> | | ||
| `ssml` | `IBooleanFlag`<`boolean`\> | | ||
| `subscription-key` | `IOptionFlag`<`undefined` \| `string`\> | | ||
| `subscription-key-env` | `IOptionFlag`<`undefined` \| `string`\> | | ||
### Functions | ||
#### getAudioFileDuration | ||
▸ **getAudioFileDuration**(`filePath`): `Promise`<`number`\> | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `filePath` | `string` | | ||
##### Returns | ||
`Promise`<`number`\> | ||
___ | ||
#### loadScript | ||
▸ **loadScript**(`scriptFilePath`): `Promise`<[`NarrationScript`](#classesnarrationscriptmd)\> | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `scriptFilePath` | `string` | | ||
##### Returns | ||
`Promise`<[`NarrationScript`](#classesnarrationscriptmd)\> | ||
___ | ||
#### playMp3File | ||
▸ **playMp3File**(`filePath`, `infoLogger`): `Promise`<`void`\> | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `filePath` | `string` | | ||
| `infoLogger` | (`msg`: `string`) => `void` | | ||
##### Returns | ||
`Promise`<`void`\> | ||
___ | ||
#### saveScript | ||
▸ **saveScript**(`script`): `Promise`<`void`\> | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `script` | [`NarrationScript`](#classesnarrationscriptmd) | | ||
##### Returns | ||
`Promise`<`void`\> | ||
▸ **saveScript**(`script`, `scriptFilePath`): `Promise`<`void`\> | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `script` | [`Script`](#interfacesnarrationscriptfilescriptmd) | | ||
| `scriptFilePath` | `string` | | ||
##### Returns | ||
`Promise`<`void`\> | ||
## Classes | ||
<a name="classesazurettsservicemd"></a> | ||
<a name="classesazure_tts_serviceazurettsservicemd"></a> | ||
[tts-narrator](#readmemd) / AzureTtsService | ||
### Class: AzureTtsService | ||
[azure-tts-service](#modulesazure_tts_servicemd).AzureTtsService | ||
#### Hierarchy | ||
- [`BaseTtsService`](#classesbasettsservicemd) | ||
- [`BaseTtsService`](#classestts_servicebasettsservicemd) | ||
↳ **`AzureTtsService`** | ||
#### Table of contents | ||
##### Constructors | ||
- [constructor](#constructor) | ||
##### Methods | ||
- [buildSpeakStartTag](#buildspeakstarttag) | ||
- [buildVoiceStartTag](#buildvoicestarttag) | ||
- [generateAudio](#generateaudio) | ||
- [generateSSML](#generatessml) | ||
- [generateSsmlWithoutValidation](#generatessmlwithoutvalidation) | ||
- [validateXML](#validatexml) | ||
#### Constructors | ||
@@ -289,3 +128,3 @@ | ||
[BaseTtsService](#classesbasettsservicemd).[constructor](#constructor) | ||
[BaseTtsService](#classestts_servicebasettsservicemd).[constructor](#constructor) | ||
@@ -302,3 +141,3 @@ #### Methods | ||
| :------ | :------ | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesvoicesettingsmd) | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | ||
@@ -311,3 +150,3 @@ ###### Returns | ||
[BaseTtsService](#classesbasettsservicemd).[buildSpeakStartTag](#buildspeakstarttag) | ||
[BaseTtsService](#classestts_servicebasettsservicemd).[buildSpeakStartTag](#buildspeakstarttag) | ||
@@ -324,3 +163,3 @@ ___ | ||
| :------ | :------ | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesvoicesettingsmd) | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | ||
@@ -333,3 +172,3 @@ ###### Returns | ||
[BaseTtsService](#classesbasettsservicemd).[buildVoiceStartTag](#buildvoicestarttag) | ||
[BaseTtsService](#classestts_servicebasettsservicemd).[buildVoiceStartTag](#buildvoicestarttag) | ||
@@ -340,3 +179,3 @@ ___ | ||
▸ **generateAudio**(`ssml`, `options`): `Promise`<`any`\> | ||
▸ **generateAudio**(`ssml`, `options`): `Promise`\<`any`\> | ||
@@ -348,11 +187,11 @@ ###### Parameters | ||
| `ssml` | `string` | | ||
| `options` | [`AzureAudioGenerationOptions`](#interfacesazureaudiogenerationoptionsmd) | | ||
| `options` | [`AzureAudioGenerationOptions`](#interfacesazure_tts_serviceazureaudiogenerationoptionsmd) | | ||
###### Returns | ||
`Promise`<`any`\> | ||
`Promise`\<`any`\> | ||
###### Overrides | ||
[BaseTtsService](#classesbasettsservicemd).[generateAudio](#generateaudio) | ||
[BaseTtsService](#classestts_servicebasettsservicemd).[generateAudio](#generateaudio) | ||
@@ -363,3 +202,3 @@ ___ | ||
▸ **generateSSML**(`paragraph`): `Promise`<`string`\> | ||
▸ **generateSSML**(`paragraph`): `Promise`\<`string`\> | ||
@@ -370,11 +209,11 @@ ###### Parameters | ||
| :------ | :------ | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarrationparagraphmd) | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | | ||
###### Returns | ||
`Promise`<`string`\> | ||
`Promise`\<`string`\> | ||
###### Inherited from | ||
[BaseTtsService](#classesbasettsservicemd).[generateSSML](#generatessml) | ||
[BaseTtsService](#classestts_servicebasettsservicemd).[generateSSML](#generatessml) | ||
@@ -391,3 +230,3 @@ ___ | ||
| :------ | :------ | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarrationparagraphmd) | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | | ||
@@ -405,3 +244,3 @@ ###### Returns | ||
[BaseTtsService](#classesbasettsservicemd).[generateSsmlWithoutValidation](#generatessmlwithoutvalidation) | ||
[BaseTtsService](#classestts_servicebasettsservicemd).[generateSsmlWithoutValidation](#generatessmlwithoutvalidation) | ||
@@ -427,80 +266,76 @@ ___ | ||
[BaseTtsService](#classesbasettsservicemd).[validateXML](#validatexml) | ||
[BaseTtsService](#classestts_servicebasettsservicemd).[validateXML](#validatexml) | ||
<a name="classesbasettsservicemd"></a> | ||
<a name="classesindexexport_md"></a> | ||
[tts-narrator](#readmemd) / BaseTtsService | ||
### Class: export= | ||
### Class: BaseTtsService | ||
[index](#modulesindexmd).export= | ||
#### Hierarchy | ||
- **`BaseTtsService`** | ||
- `Command` | ||
↳ [`AzureTtsService`](#classesazurettsservicemd) | ||
↳ **`export=`** | ||
#### Implements | ||
#### Constructors | ||
- [`TtsService`](#interfacesttsservicemd) | ||
##### constructor | ||
#### Table of contents | ||
• **new export=**(`argv`, `config`) | ||
##### Constructors | ||
###### Parameters | ||
- [constructor](#constructor) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `argv` | `string`[] | | ||
| `config` | `Config` | | ||
##### Methods | ||
###### Inherited from | ||
- [buildSpeakStartTag](#buildspeakstarttag) | ||
- [buildVoiceStartTag](#buildvoicestarttag) | ||
- [generateAudio](#generateaudio) | ||
- [generateSSML](#generatessml) | ||
- [generateSsmlWithoutValidation](#generatessmlwithoutvalidation) | ||
- [validateXML](#validatexml) | ||
Command.constructor | ||
#### Constructors | ||
#### Properties | ||
##### constructor | ||
| Property | Description | | ||
| --- | --- | | ||
| `Static` **args**: `Object` | Type declaration<br><br>| Name | Type |<br>| :------ | :------ |<br>| `file` | `Arg`\<`string`, `Record`\<`string`, `unknown`\>\> |<br>Overrides<br><br>Command.args | | ||
| `Static` **description**: `string` = `'Generate narration with Text-To-Speech technology'` | Overrides<br><br>Command.description | | ||
| `Static` **examples**: `string`[] | Overrides<br><br>Command.examples | | ||
| `Static` **flags**: `Object` | Type declaration<br><br>| Name | Type |<br>| :------ | :------ |<br>| `chapters` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> |<br>| `debug` | `BooleanFlag`\<`boolean`\> |<br>| `dry-run` | `BooleanFlag`\<`boolean`\> |<br>| `interactive` | `BooleanFlag`\<`boolean`\> |<br>| `overwrite` | `BooleanFlag`\<`boolean`\> |<br>| `play` | `BooleanFlag`\<`boolean`\> |<br>| `quiet` | `BooleanFlag`\<`boolean`\> |<br>| `region` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> |<br>| `sections` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> |<br>| `service` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> |<br>| `ssml` | `BooleanFlag`\<`boolean`\> |<br>| `subscription-key` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> |<br>| `subscription-key-env` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> |<br>Overrides<br><br>Command.flags | | ||
| `Static` **id**: `string` = `' '` | Overrides<br><br>Command.id | | ||
• **new BaseTtsService**() | ||
#### Methods | ||
##### buildSpeakStartTag | ||
##### run | ||
▸ `Protected` **buildSpeakStartTag**(`voiceSettings`): `string` | ||
▸ **run**(): `Promise`\<`void`\> | ||
###### Parameters | ||
###### Returns | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesvoicesettingsmd) | | ||
`Promise`\<`void`\> | ||
###### Returns | ||
###### Overrides | ||
`string` | ||
Command.run | ||
___ | ||
##### buildVoiceStartTag | ||
<a name="classesnarration_scriptnarrationchaptermd"></a> | ||
▸ `Protected` **buildVoiceStartTag**(`voiceSettings`): `string` | ||
### Class: NarrationChapter | ||
###### Parameters | ||
[narration-script](#modulesnarration_scriptmd).NarrationChapter | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesvoicesettingsmd) | | ||
#### Implements | ||
###### Returns | ||
- [`Chapter`](#interfacesnarration_scriptnarrationscriptfilechaptermd) | ||
`string` | ||
#### Constructors | ||
___ | ||
##### constructor | ||
##### generateAudio | ||
• **new NarrationChapter**(`chapter`, `index`, `script`) | ||
▸ **generateAudio**(`_ssml`, `_options`): `Promise`<`void`\> | ||
###### Parameters | ||
@@ -510,60 +345,50 @@ | ||
| :------ | :------ | | ||
| `_ssml` | `string` | | ||
| `_options` | [`AudioGenerationOptions`](#interfacesaudiogenerationoptionsmd) | | ||
| `chapter` | [`Chapter`](#interfacesnarration_scriptnarrationscriptfilechaptermd) | | ||
| `index` | `number` | | ||
| `script` | [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | ||
###### Returns | ||
#### Properties | ||
`Promise`<`void`\> | ||
| Property | Description | | ||
| --- | --- | | ||
| `Protected` **chapter**: [`Chapter`](#interfacesnarration_scriptnarrationscriptfilechaptermd) | | | ||
| **index**: `number` | | | ||
| **script**: [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | | ||
| **sections**: [`NarrationSection`](#classesnarration_scriptnarrationsectionmd)[] | Implementation of<br><br>[Chapter](#interfacesnarration_scriptnarrationscriptfilechaptermd).[sections](#sections) | | ||
###### Implementation of | ||
[TtsService](#interfacesttsservicemd).[generateAudio](#generateaudio) | ||
#### Accessors | ||
___ | ||
##### key | ||
##### generateSSML | ||
• `get` **key**(): `string` | ||
▸ **generateSSML**(`paragraph`): `Promise`<`string`\> | ||
###### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarrationparagraphmd) | | ||
###### Returns | ||
`Promise`<`string`\> | ||
`string` | ||
###### Implementation of | ||
[TtsService](#interfacesttsservicemd).[generateSSML](#generatessml) | ||
[Chapter](#interfacesnarration_scriptnarrationscriptfilechaptermd).[key](#key) | ||
___ | ||
##### generateSsmlWithoutValidation | ||
##### settings | ||
▸ `Protected` **generateSsmlWithoutValidation**(`paragraph`): `Object` | ||
• `get` **settings**(): [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | ||
###### Parameters | ||
###### Returns | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarrationparagraphmd) | | ||
[`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | ||
###### Returns | ||
###### Implementation of | ||
`Object` | ||
[Chapter](#interfacesnarration_scriptnarrationscriptfilechaptermd).[settings](#settings) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `lineOffset` | `number` | | ||
| `ssml` | `string` | | ||
#### Methods | ||
___ | ||
##### getSectionByKey | ||
##### validateXML | ||
▸ **getSectionByKey**(`key`): `undefined` \| [`NarrationSection`](#classesnarration_scriptnarrationsectionmd) | ||
▸ `Protected` **validateXML**(`xml`, `lineOffset`): `void` | ||
###### Parameters | ||
@@ -573,42 +398,19 @@ | ||
| :------ | :------ | | ||
| `xml` | `string` | | ||
| `lineOffset` | `number` | | ||
| `key` | `string` | | ||
###### Returns | ||
`void` | ||
`undefined` \| [`NarrationSection`](#classesnarration_scriptnarrationsectionmd) | ||
<a name="classesnarrationchaptermd"></a> | ||
<a name="classesnarration_scriptnarrationparagraphmd"></a> | ||
[tts-narrator](#readmemd) / NarrationChapter | ||
### Class: NarrationParagraph | ||
### Class: NarrationChapter | ||
[narration-script](#modulesnarration_scriptmd).NarrationParagraph | ||
#### Implements | ||
- [`Chapter`](#interfacesnarrationscriptfilechaptermd) | ||
- [`Paragraph`](#interfacesnarration_scriptnarrationscriptfileparagraphmd) | ||
#### Table of contents | ||
##### Constructors | ||
- [constructor](#constructor) | ||
##### Properties | ||
- [chapter](#chapter) | ||
- [index](#index) | ||
- [script](#script) | ||
- [sections](#sections) | ||
##### Accessors | ||
- [key](#key) | ||
- [settings](#settings) | ||
##### Methods | ||
- [getSectionByKey](#getsectionbykey) | ||
#### Constructors | ||
@@ -618,3 +420,3 @@ | ||
• **new NarrationChapter**(`chapter`, `index`, `script`) | ||
• **new NarrationParagraph**(`paragraph`, `index`, `section`, `chapter`, `script`) | ||
@@ -625,39 +427,53 @@ ###### Parameters | ||
| :------ | :------ | | ||
| `chapter` | [`Chapter`](#interfacesnarrationscriptfilechaptermd) | | ||
| `paragraph` | [`Paragraph`](#interfacesnarration_scriptnarrationscriptfileparagraphmd) | | ||
| `index` | `number` | | ||
| `script` | [`NarrationScript`](#classesnarrationscriptmd) | | ||
| `section` | [`NarrationSection`](#classesnarration_scriptnarrationsectionmd) | | ||
| `chapter` | [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd) | | ||
| `script` | [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | ||
#### Properties | ||
##### chapter | ||
| Property | Description | | ||
| --- | --- | | ||
| `Optional` **audioFilePath**: `string` | Path of the generated audio file. Only for in-memory processing, not supposed to be stored in file. | | ||
| **chapter**: [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd) | | | ||
| **index**: `number` | | | ||
| `Protected` **paragraph**: [`Paragraph`](#interfacesnarration_scriptnarrationscriptfileparagraphmd) | | | ||
| **script**: [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | | ||
| **section**: [`NarrationSection`](#classesnarration_scriptnarrationsectionmd) | | | ||
• `Protected` **chapter**: [`Chapter`](#interfacesnarrationscriptfilechaptermd) | ||
___ | ||
#### Accessors | ||
##### index | ||
##### key | ||
• **index**: `number` | ||
• `get` **key**(): `string` | ||
___ | ||
###### Returns | ||
##### script | ||
`string` | ||
• **script**: [`NarrationScript`](#classesnarrationscriptmd) | ||
###### Implementation of | ||
[Paragraph](#interfacesnarration_scriptnarrationscriptfileparagraphmd).[key](#key) | ||
___ | ||
##### sections | ||
##### settings | ||
• **sections**: [`NarrationSection`](#classesnarrationsectionmd)[] | ||
• `get` **settings**(): [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | ||
###### Returns | ||
[`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | ||
###### Implementation of | ||
[Chapter](#interfacesnarrationscriptfilechaptermd).[sections](#sections) | ||
[Paragraph](#interfacesnarration_scriptnarrationscriptfileparagraphmd).[settings](#settings) | ||
#### Accessors | ||
___ | ||
##### key | ||
##### text | ||
• `get` **key**(): `string` | ||
• `get` **text**(): `string` | ||
@@ -670,24 +486,21 @@ ###### Returns | ||
[Chapter](#interfacesnarrationscriptfilechaptermd).[key](#key) | ||
[Paragraph](#interfacesnarration_scriptnarrationscriptfileparagraphmd).[text](#text) | ||
___ | ||
##### settings | ||
<a name="classesnarration_scriptnarrationscriptmd"></a> | ||
• `get` **settings**(): [`VoiceSettings`](#interfacesvoicesettingsmd) | ||
### Class: NarrationScript | ||
###### Returns | ||
[narration-script](#modulesnarration_scriptmd).NarrationScript | ||
[`VoiceSettings`](#interfacesvoicesettingsmd) | ||
#### Implements | ||
###### Implementation of | ||
- [`Script`](#interfacesnarration_scriptnarrationscriptfilescriptmd) | ||
[Chapter](#interfacesnarrationscriptfilechaptermd).[settings](#settings) | ||
#### Constructors | ||
#### Methods | ||
##### constructor | ||
##### getSectionByKey | ||
• **new NarrationScript**(`script`, `scriptFilePath`) | ||
▸ **getSectionByKey**(`key`): `undefined` \| [`NarrationSection`](#classesnarrationsectionmd) | ||
###### Parameters | ||
@@ -697,45 +510,43 @@ | ||
| :------ | :------ | | ||
| `key` | `string` | | ||
| `script` | [`Script`](#interfacesnarration_scriptnarrationscriptfilescriptmd) | | ||
| `scriptFilePath` | `string` | | ||
###### Returns | ||
#### Properties | ||
`undefined` \| [`NarrationSection`](#classesnarrationsectionmd) | ||
| Property | Description | | ||
| --- | --- | | ||
| **chapters**: [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd)[] | Implementation of<br><br>[Script](#interfacesnarration_scriptnarrationscriptfilescriptmd).[chapters](#chapters) | | ||
| `Protected` **script**: [`Script`](#interfacesnarration_scriptnarrationscriptfilescriptmd) | | | ||
| **scriptFilePath**: `string` | | | ||
<a name="classesnarrationparagraphmd"></a> | ||
#### Accessors | ||
[tts-narrator](#readmemd) / NarrationParagraph | ||
##### settings | ||
### Class: NarrationParagraph | ||
• `get` **settings**(): [`ScriptSettings`](#interfacesnarration_scriptscriptsettingsmd) | ||
#### Implements | ||
###### Returns | ||
- [`Paragraph`](#interfacesnarrationscriptfileparagraphmd) | ||
[`ScriptSettings`](#interfacesnarration_scriptscriptsettingsmd) | ||
#### Table of contents | ||
###### Implementation of | ||
##### Constructors | ||
[Script](#interfacesnarration_scriptnarrationscriptfilescriptmd).[settings](#settings) | ||
- [constructor](#constructor) | ||
#### Methods | ||
##### Properties | ||
##### export | ||
- [audioFilePath](#audiofilepath) | ||
- [chapter](#chapter) | ||
- [index](#index) | ||
- [paragraph](#paragraph) | ||
- [script](#script) | ||
- [section](#section) | ||
▸ **export**(): [`Script`](#interfacesnarration_scriptnarrationscriptfilescriptmd) | ||
##### Accessors | ||
###### Returns | ||
- [key](#key) | ||
- [settings](#settings) | ||
- [text](#text) | ||
[`Script`](#interfacesnarration_scriptnarrationscriptfilescriptmd) | ||
#### Constructors | ||
___ | ||
##### constructor | ||
##### getChapterByKey | ||
• **new NarrationParagraph**(`paragraph`, `index`, `section`, `chapter`, `script`) | ||
▸ **getChapterByKey**(`key`): `undefined` \| [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd) | ||
@@ -746,46 +557,45 @@ ###### Parameters | ||
| :------ | :------ | | ||
| `paragraph` | [`Paragraph`](#interfacesnarrationscriptfileparagraphmd) | | ||
| `index` | `number` | | ||
| `section` | [`NarrationSection`](#classesnarrationsectionmd) | | ||
| `chapter` | [`NarrationChapter`](#classesnarrationchaptermd) | | ||
| `script` | [`NarrationScript`](#classesnarrationscriptmd) | | ||
| `key` | `string` | | ||
#### Properties | ||
###### Returns | ||
##### audioFilePath | ||
`undefined` \| [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd) | ||
• `Optional` **audioFilePath**: `string` | ||
Path of the generated audio file. Only for in-memory processing, not supposed to be stored in file. | ||
<a name="classesnarration_scriptnarrationsectionmd"></a> | ||
___ | ||
### Class: NarrationSection | ||
##### chapter | ||
[narration-script](#modulesnarration_scriptmd).NarrationSection | ||
• **chapter**: [`NarrationChapter`](#classesnarrationchaptermd) | ||
#### Implements | ||
___ | ||
- [`Section`](#interfacesnarration_scriptnarrationscriptfilesectionmd) | ||
##### index | ||
#### Constructors | ||
• **index**: `number` | ||
##### constructor | ||
___ | ||
• **new NarrationSection**(`section`, `index`, `chapter`, `script`) | ||
##### paragraph | ||
###### Parameters | ||
• `Protected` **paragraph**: [`Paragraph`](#interfacesnarrationscriptfileparagraphmd) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `section` | [`Section`](#interfacesnarration_scriptnarrationscriptfilesectionmd) | | ||
| `index` | `number` | | ||
| `chapter` | [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd) | | ||
| `script` | [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | ||
___ | ||
#### Properties | ||
##### script | ||
| Property | Description | | ||
| --- | --- | | ||
| **chapter**: [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd) | | | ||
| **index**: `number` | | | ||
| **paragraphs**: [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd)[] | Implementation of<br><br>[Section](#interfacesnarration_scriptnarrationscriptfilesectionmd).[paragraphs](#paragraphs) | | ||
| **script**: [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | | ||
| `Protected` **section**: [`Section`](#interfacesnarration_scriptnarrationscriptfilesectionmd) | | | ||
• **script**: [`NarrationScript`](#classesnarrationscriptmd) | ||
___ | ||
##### section | ||
• **section**: [`NarrationSection`](#classesnarrationsectionmd) | ||
#### Accessors | ||
@@ -803,3 +613,3 @@ | ||
[Paragraph](#interfacesnarrationscriptfileparagraphmd).[key](#key) | ||
[Section](#interfacesnarration_scriptnarrationscriptfilesectionmd).[key](#key) | ||
@@ -810,64 +620,80 @@ ___ | ||
• `get` **settings**(): [`VoiceSettings`](#interfacesvoicesettingsmd) | ||
• `get` **settings**(): [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | ||
###### Returns | ||
[`VoiceSettings`](#interfacesvoicesettingsmd) | ||
[`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | ||
###### Implementation of | ||
[Paragraph](#interfacesnarrationscriptfileparagraphmd).[settings](#settings) | ||
[Section](#interfacesnarration_scriptnarrationscriptfilesectionmd).[settings](#settings) | ||
___ | ||
##### text | ||
<a name="classesscript_processorscriptprocessormd"></a> | ||
• `get` **text**(): `string` | ||
### Class: ScriptProcessor | ||
###### Returns | ||
[script-processor](#modulesscript_processormd).ScriptProcessor | ||
`string` | ||
#### Constructors | ||
###### Implementation of | ||
##### constructor | ||
[Paragraph](#interfacesnarrationscriptfileparagraphmd).[text](#text) | ||
• **new ScriptProcessor**(`scriptFilePath`, `flags`, `cliConsole?`) | ||
###### Parameters | ||
<a name="classesnarrationscriptmd"></a> | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `scriptFilePath` | `string` | | ||
| `flags` | `Object` & `FlagOutput` & {} | | ||
| `cliConsole?` | `LineLogger`\<(`message?`: `any`, ...`optionalParams`: `any`[]) => `void`, (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`, (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`, (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`\> | | ||
[tts-narrator](#readmemd) / NarrationScript | ||
#### Properties | ||
### Class: NarrationScript | ||
| Property | Description | | ||
| --- | --- | | ||
| `Protected` **\_script**: [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | | ||
| `Protected` **audioGenerationOptions**: `undefined` \| [`AudioGenerationOptions`](#interfacestts_serviceaudiogenerationoptionsmd) | | | ||
| `Protected` **chapterRange**: `undefined` \| `MultiRange` | | | ||
| `Protected` **cliConsole**: `LineLogger`\<(`message?`: `any`, ...`optionalParams`: `any`[]) => `void`, (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`, (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`, (`message?`: `any`, ...`optionalParams`: `any`[]) => `void`\> | | | ||
| `Protected` **flags**: `Object` & `FlagOutput` & {} | | | ||
| `Protected` **scriptFilePath**: `string` | | | ||
| `Protected` **sectionRange**: `undefined` \| `MultiRange` | | | ||
| `Protected` **ttsService**: [`TtsService`](#interfacestts_servicettsservicemd) | | | ||
#### Implements | ||
- [`Script`](#interfacesnarrationscriptfilescriptmd) | ||
#### Accessors | ||
#### Table of contents | ||
##### script | ||
##### Constructors | ||
• `get` **script**(): [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | ||
- [constructor](#constructor) | ||
###### Returns | ||
##### Properties | ||
[`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | ||
- [chapters](#chapters) | ||
- [script](#script) | ||
- [scriptFilePath](#scriptfilepath) | ||
#### Methods | ||
##### Accessors | ||
##### determineAudioFilePath | ||
- [settings](#settings) | ||
▸ `Protected` **determineAudioFilePath**(`ssmlHash`, `_paragraph`): `Promise`\<`string`\> | ||
##### Methods | ||
###### Parameters | ||
- [export](#export) | ||
- [getChapterByKey](#getchapterbykey) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `ssmlHash` | `string` | | ||
| `_paragraph` | [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | | ||
#### Constructors | ||
###### Returns | ||
##### constructor | ||
`Promise`\<`string`\> | ||
• **new NarrationScript**(`script`, `scriptFilePath`) | ||
___ | ||
##### hash | ||
▸ `Protected` **hash**(`ssml`, `_paragraph`): `string` | ||
###### Parameters | ||
@@ -877,56 +703,44 @@ | ||
| :------ | :------ | | ||
| `script` | [`Script`](#interfacesnarrationscriptfilescriptmd) | | ||
| `scriptFilePath` | `string` | | ||
| `ssml` | `string` | | ||
| `_paragraph` | [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | | ||
#### Properties | ||
###### Returns | ||
##### chapters | ||
`string` | ||
• **chapters**: [`NarrationChapter`](#classesnarrationchaptermd)[] | ||
___ | ||
###### Implementation of | ||
##### initialiseTtsServiceIfNeeded | ||
[Script](#interfacesnarrationscriptfilescriptmd).[chapters](#chapters) | ||
▸ `Protected` **initialiseTtsServiceIfNeeded**(): `Promise`\<`void`\> | ||
___ | ||
###### Returns | ||
##### script | ||
`Promise`\<`void`\> | ||
• `Protected` **script**: [`Script`](#interfacesnarrationscriptfilescriptmd) | ||
___ | ||
##### scriptFilePath | ||
##### loadScript | ||
• **scriptFilePath**: `string` | ||
▸ `Protected` **loadScript**(): `Promise`\<`void`\> | ||
#### Accessors | ||
##### settings | ||
• `get` **settings**(): [`ScriptSettings`](#interfacesscriptsettingsmd) | ||
###### Returns | ||
[`ScriptSettings`](#interfacesscriptsettingsmd) | ||
`Promise`\<`void`\> | ||
###### Implementation of | ||
___ | ||
[Script](#interfacesnarrationscriptfilescriptmd).[settings](#settings) | ||
##### parseRanges | ||
#### Methods | ||
▸ `Protected` **parseRanges**(): `void` | ||
##### export | ||
▸ **export**(): [`Script`](#interfacesnarrationscriptfilescriptmd) | ||
###### Returns | ||
[`Script`](#interfacesnarrationscriptfilescriptmd) | ||
`void` | ||
___ | ||
##### getChapterByKey | ||
##### processGeneratedAudioFile | ||
▸ **getChapterByKey**(`key`): `undefined` \| [`NarrationChapter`](#classesnarrationchaptermd) | ||
▸ `Protected` **processGeneratedAudioFile**(`audioFilePath`): `Promise`\<`string`\> | ||
@@ -937,93 +751,91 @@ ###### Parameters | ||
| :------ | :------ | | ||
| `key` | `string` | | ||
| `audioFilePath` | `string` | | ||
###### Returns | ||
`undefined` \| [`NarrationChapter`](#classesnarrationchaptermd) | ||
`Promise`\<`string`\> | ||
___ | ||
<a name="classesnarrationsectionmd"></a> | ||
##### run | ||
[tts-narrator](#readmemd) / NarrationSection | ||
▸ **run**(`reconstructedcommandLine?`): `Promise`\<`void`\> | ||
### Class: NarrationSection | ||
###### Parameters | ||
#### Implements | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `reconstructedcommandLine?` | `string` | | ||
- [`Section`](#interfacesnarrationscriptfilesectionmd) | ||
###### Returns | ||
#### Table of contents | ||
`Promise`\<`void`\> | ||
##### Constructors | ||
___ | ||
- [constructor](#constructor) | ||
##### runWithoutCatch | ||
##### Properties | ||
▸ **runWithoutCatch**(`reconstructedcommandLine?`): `Promise`\<`void`\> | ||
- [chapter](#chapter) | ||
- [index](#index) | ||
- [paragraphs](#paragraphs) | ||
- [script](#script) | ||
- [section](#section) | ||
###### Parameters | ||
##### Accessors | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `reconstructedcommandLine?` | `string` | | ||
- [key](#key) | ||
- [settings](#settings) | ||
###### Returns | ||
#### Constructors | ||
`Promise`\<`void`\> | ||
##### constructor | ||
• **new NarrationSection**(`section`, `index`, `chapter`, `script`) | ||
<a name="classestts_servicebasettsservicemd"></a> | ||
###### Parameters | ||
### Class: BaseTtsService | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `section` | [`Section`](#interfacesnarrationscriptfilesectionmd) | | ||
| `index` | `number` | | ||
| `chapter` | [`NarrationChapter`](#classesnarrationchaptermd) | | ||
| `script` | [`NarrationScript`](#classesnarrationscriptmd) | | ||
[tts-service](#modulestts_servicemd).BaseTtsService | ||
#### Properties | ||
#### Hierarchy | ||
##### chapter | ||
- **`BaseTtsService`** | ||
• **chapter**: [`NarrationChapter`](#classesnarrationchaptermd) | ||
↳ [`AzureTtsService`](#classesazure_tts_serviceazurettsservicemd) | ||
___ | ||
#### Implements | ||
##### index | ||
- [`TtsService`](#interfacestts_servicettsservicemd) | ||
• **index**: `number` | ||
#### Constructors | ||
___ | ||
##### constructor | ||
##### paragraphs | ||
• **new BaseTtsService**() | ||
• **paragraphs**: [`NarrationParagraph`](#classesnarrationparagraphmd)[] | ||
#### Methods | ||
###### Implementation of | ||
##### buildSpeakStartTag | ||
[Section](#interfacesnarrationscriptfilesectionmd).[paragraphs](#paragraphs) | ||
▸ `Protected` **buildSpeakStartTag**(`voiceSettings`): `string` | ||
___ | ||
###### Parameters | ||
##### script | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | ||
• **script**: [`NarrationScript`](#classesnarrationscriptmd) | ||
###### Returns | ||
`string` | ||
___ | ||
##### section | ||
##### buildVoiceStartTag | ||
• `Protected` **section**: [`Section`](#interfacesnarrationscriptfilesectionmd) | ||
▸ `Protected` **buildVoiceStartTag**(`voiceSettings`): `string` | ||
#### Accessors | ||
###### Parameters | ||
##### key | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `voiceSettings` | [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | ||
• `get` **key**(): `string` | ||
###### Returns | ||
@@ -1033,65 +845,49 @@ | ||
###### Implementation of | ||
___ | ||
[Section](#interfacesnarrationscriptfilesectionmd).[key](#key) | ||
##### generateAudio | ||
___ | ||
▸ **generateAudio**(`_ssml`, `_options`): `Promise`\<`void`\> | ||
##### settings | ||
###### Parameters | ||
• `get` **settings**(): [`VoiceSettings`](#interfacesvoicesettingsmd) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `_ssml` | `string` | | ||
| `_options` | [`AudioGenerationOptions`](#interfacestts_serviceaudiogenerationoptionsmd) | | ||
###### Returns | ||
[`VoiceSettings`](#interfacesvoicesettingsmd) | ||
`Promise`\<`void`\> | ||
###### Implementation of | ||
[Section](#interfacesnarrationscriptfilesectionmd).[settings](#settings) | ||
[TtsService](#interfacestts_servicettsservicemd).[generateAudio](#generateaudio) | ||
___ | ||
<a name="classesscriptprocessormd"></a> | ||
##### generateSSML | ||
[tts-narrator](#readmemd) / ScriptProcessor | ||
▸ **generateSSML**(`paragraph`): `Promise`\<`string`\> | ||
### Class: ScriptProcessor | ||
###### Parameters | ||
#### Table of contents | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | | ||
##### Constructors | ||
###### Returns | ||
- [constructor](#constructor) | ||
`Promise`\<`string`\> | ||
##### Properties | ||
###### Implementation of | ||
- [\_script](#_script) | ||
- [audioGenerationOptions](#audiogenerationoptions) | ||
- [chapterRange](#chapterrange) | ||
- [cliConsole](#cliconsole) | ||
- [flags](#flags) | ||
- [scriptFilePath](#scriptfilepath) | ||
- [sectionRange](#sectionrange) | ||
- [ttsService](#ttsservice) | ||
[TtsService](#interfacestts_servicettsservicemd).[generateSSML](#generatessml) | ||
##### Accessors | ||
___ | ||
- [script](#script) | ||
##### generateSsmlWithoutValidation | ||
##### Methods | ||
▸ `Protected` **generateSsmlWithoutValidation**(`paragraph`): `Object` | ||
- [determineAudioFilePath](#determineaudiofilepath) | ||
- [hash](#hash) | ||
- [initialiseTtsServiceIfNeeded](#initialisettsserviceifneeded) | ||
- [loadScript](#loadscript) | ||
- [parseRanges](#parseranges) | ||
- [processGeneratedAudioFile](#processgeneratedaudiofile) | ||
- [run](#run) | ||
- [runWithoutCatch](#runwithoutcatch) | ||
#### Constructors | ||
##### constructor | ||
• **new ScriptProcessor**(`scriptFilePath`, `flags`, `cliConsole?`) | ||
###### Parameters | ||
@@ -1101,536 +897,555 @@ | ||
| :------ | :------ | | ||
| `scriptFilePath` | `string` | | ||
| `flags` | `Object` | | ||
| `cliConsole?` | `CliConsole`<`fn`, `fn`, `fn`, `fn`\> | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | | ||
#### Properties | ||
###### Returns | ||
##### \_script | ||
`Object` | ||
• `Protected` **\_script**: [`NarrationScript`](#classesnarrationscriptmd) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `lineOffset` | `number` | | ||
| `ssml` | `string` | | ||
___ | ||
##### audioGenerationOptions | ||
##### validateXML | ||
• `Protected` **audioGenerationOptions**: `undefined` \| [`AudioGenerationOptions`](#interfacesaudiogenerationoptionsmd) | ||
▸ `Protected` **validateXML**(`xml`, `lineOffset`): `void` | ||
___ | ||
###### Parameters | ||
##### chapterRange | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `xml` | `string` | | ||
| `lineOffset` | `number` | | ||
• `Protected` **chapterRange**: `undefined` \| `MultiRange` | ||
###### Returns | ||
___ | ||
`void` | ||
##### cliConsole | ||
## Enums | ||
• `Protected` **cliConsole**: `CliConsole`<`fn`, `fn`, `fn`, `fn`\> | ||
___ | ||
<a name="enumsscript_processorttsservicetypemd"></a> | ||
##### flags | ||
### Enumeration: TtsServiceType | ||
• `Protected` **flags**: `Object` | ||
[script-processor](#modulesscript_processormd).TtsServiceType | ||
___ | ||
#### Enumeration Members | ||
##### scriptFilePath | ||
##### Azure | ||
• `Protected` **scriptFilePath**: `string` | ||
• **Azure** = ``"azure"`` | ||
___ | ||
## Interfaces | ||
##### sectionRange | ||
• `Protected` **sectionRange**: `undefined` \| `MultiRange` | ||
<a name="interfacesazure_tts_serviceazureaudiogenerationoptionsmd"></a> | ||
___ | ||
### Interface: AzureAudioGenerationOptions | ||
##### ttsService | ||
[azure-tts-service](#modulesazure_tts_servicemd).AzureAudioGenerationOptions | ||
• `Protected` **ttsService**: [`TtsService`](#interfacesttsservicemd) | ||
#### Hierarchy | ||
#### Accessors | ||
- [`AudioGenerationOptions`](#interfacestts_serviceaudiogenerationoptionsmd) | ||
##### script | ||
↳ **`AzureAudioGenerationOptions`** | ||
• `get` **script**(): [`NarrationScript`](#classesnarrationscriptmd) | ||
#### Properties | ||
###### Returns | ||
| Property | Description | | ||
| --- | --- | | ||
| **outputFilePath**: `string` | Inherited from<br><br>[AudioGenerationOptions](#interfacestts_serviceaudiogenerationoptionsmd).[outputFilePath](#outputfilepath) | | ||
| `Optional` **serviceRegion**: `string` | | | ||
| `Optional` **subscriptionKey**: `string` | | | ||
[`NarrationScript`](#classesnarrationscriptmd) | ||
#### Methods | ||
##### determineAudioFilePath | ||
<a name="interfacesnarration_scriptnarrationscriptfilechaptermd"></a> | ||
▸ `Protected` **determineAudioFilePath**(`ssmlHash`, `_paragraph`): `Promise`<`string`\> | ||
### Interface: Chapter | ||
###### Parameters | ||
[narration-script](#modulesnarration_scriptmd).[NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd).Chapter | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `ssmlHash` | `string` | | ||
| `_paragraph` | [`NarrationParagraph`](#classesnarrationparagraphmd) | | ||
#### Implemented by | ||
###### Returns | ||
- [`NarrationChapter`](#classesnarration_scriptnarrationchaptermd) | ||
`Promise`<`string`\> | ||
#### Properties | ||
___ | ||
| Property | Description | | ||
| --- | --- | | ||
| `Optional` **key**: `string` | | | ||
| **sections**: [`Section`](#interfacesnarration_scriptnarrationscriptfilesectionmd)[] | | | ||
| `Optional` **settings**: [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | | ||
##### hash | ||
▸ `Protected` **hash**(`ssml`, `_paragraph`): `string` | ||
###### Parameters | ||
<a name="interfacesnarration_scriptnarrationscriptfileparagraphmd"></a> | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `ssml` | `string` | | ||
| `_paragraph` | [`NarrationParagraph`](#classesnarrationparagraphmd) | | ||
### Interface: Paragraph | ||
###### Returns | ||
[narration-script](#modulesnarration_scriptmd).[NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd).Paragraph | ||
`string` | ||
#### Implemented by | ||
___ | ||
- [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | ||
##### initialiseTtsServiceIfNeeded | ||
#### Properties | ||
▸ `Protected` **initialiseTtsServiceIfNeeded**(): `Promise`<`void`\> | ||
| Property | Description | | ||
| --- | --- | | ||
| `Optional` **key**: `string` | | | ||
| `Optional` **settings**: [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | | ||
| **text**: `string` | | | ||
###### Returns | ||
`Promise`<`void`\> | ||
___ | ||
<a name="interfacesnarration_scriptnarrationscriptfilescriptmd"></a> | ||
##### loadScript | ||
### Interface: Script | ||
▸ `Protected` **loadScript**(): `Promise`<`void`\> | ||
[narration-script](#modulesnarration_scriptmd).[NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd).Script | ||
###### Returns | ||
#### Implemented by | ||
`Promise`<`void`\> | ||
- [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | ||
___ | ||
#### Properties | ||
##### parseRanges | ||
| Property | Description | | ||
| --- | --- | | ||
| **chapters**: [`Chapter`](#interfacesnarration_scriptnarrationscriptfilechaptermd)[] | | | ||
| **settings**: [`ScriptSettings`](#interfacesnarration_scriptscriptsettingsmd) | | | ||
▸ `Protected` **parseRanges**(): `void` | ||
###### Returns | ||
`void` | ||
<a name="interfacesnarration_scriptnarrationscriptfilesectionmd"></a> | ||
___ | ||
### Interface: Section | ||
##### processGeneratedAudioFile | ||
[narration-script](#modulesnarration_scriptmd).[NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd).Section | ||
▸ `Protected` **processGeneratedAudioFile**(`audioFilePath`): `Promise`<`string`\> | ||
#### Implemented by | ||
###### Parameters | ||
- [`NarrationSection`](#classesnarration_scriptnarrationsectionmd) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `audioFilePath` | `string` | | ||
#### Properties | ||
###### Returns | ||
| Property | Description | | ||
| --- | --- | | ||
| `Optional` **key**: `string` | | | ||
| **paragraphs**: [`Paragraph`](#interfacesnarration_scriptnarrationscriptfileparagraphmd)[] | | | ||
| `Optional` **settings**: [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | | ||
`Promise`<`string`\> | ||
___ | ||
##### run | ||
<a name="interfacesnarration_scriptscriptsettingsmd"></a> | ||
▸ **run**(`reconstructedcommandLine?`): `Promise`<`void`\> | ||
### Interface: ScriptSettings | ||
###### Parameters | ||
[narration-script](#modulesnarration_scriptmd).ScriptSettings | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `reconstructedcommandLine?` | `string` | | ||
#### Properties | ||
###### Returns | ||
| Property | Description | | ||
| --- | --- | | ||
| `Optional` **service**: [`Azure`](#azure) | | | ||
| `Optional` **voice**: [`VoiceSettings`](#interfacesnarration_scriptvoicesettingsmd) | | | ||
`Promise`<`void`\> | ||
___ | ||
##### runWithoutCatch | ||
<a name="interfacesnarration_scriptvoicesettingsmd"></a> | ||
▸ **runWithoutCatch**(`reconstructedcommandLine?`): `Promise`<`void`\> | ||
### Interface: VoiceSettings | ||
###### Parameters | ||
[narration-script](#modulesnarration_scriptmd).VoiceSettings | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `reconstructedcommandLine?` | `string` | | ||
#### Properties | ||
###### Returns | ||
| Property | Description | | ||
| --- | --- | | ||
| `Optional` **language**: `string` | | | ||
| `Optional` **name**: `string` | | | ||
`Promise`<`void`\> | ||
## Enums | ||
<a name="interfacestts_serviceaudiogenerationoptionsmd"></a> | ||
<a name="enumsttsservicetypemd"></a> | ||
### Interface: AudioGenerationOptions | ||
[tts-narrator](#readmemd) / TtsServiceType | ||
[tts-service](#modulestts_servicemd).AudioGenerationOptions | ||
### Enumeration: TtsServiceType | ||
#### Hierarchy | ||
#### Table of contents | ||
- **`AudioGenerationOptions`** | ||
##### Enumeration members | ||
↳ [`AzureAudioGenerationOptions`](#interfacesazure_tts_serviceazureaudiogenerationoptionsmd) | ||
- [Azure](#azure) | ||
#### Properties | ||
#### Enumeration members | ||
| Property | Description | | ||
| --- | --- | | ||
| **outputFilePath**: `string` | | | ||
##### Azure | ||
• **Azure** = `"azure"` | ||
## Interfaces | ||
<a name="interfacestts_servicettsservicemd"></a> | ||
### Interface: TtsService | ||
<a name="interfacesaudiogenerationoptionsmd"></a> | ||
[tts-service](#modulestts_servicemd).TtsService | ||
[tts-narrator](#readmemd) / AudioGenerationOptions | ||
#### Implemented by | ||
### Interface: AudioGenerationOptions | ||
- [`BaseTtsService`](#classestts_servicebasettsservicemd) | ||
#### Hierarchy | ||
#### Methods | ||
- **`AudioGenerationOptions`** | ||
##### generateAudio | ||
↳ [`AzureAudioGenerationOptions`](#interfacesazureaudiogenerationoptionsmd) | ||
▸ **generateAudio**(`ssml`, `options`): `Promise`\<`void`\> | ||
#### Table of contents | ||
###### Parameters | ||
##### Properties | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `ssml` | `string` | | ||
| `options` | [`AudioGenerationOptions`](#interfacestts_serviceaudiogenerationoptionsmd) | | ||
- [outputFilePath](#outputfilepath) | ||
###### Returns | ||
#### Properties | ||
`Promise`\<`void`\> | ||
##### outputFilePath | ||
___ | ||
• **outputFilePath**: `string` | ||
##### generateSSML | ||
▸ **generateSSML**(`paragraph`): `Promise`\<`string`\> | ||
<a name="interfacesazureaudiogenerationoptionsmd"></a> | ||
###### Parameters | ||
[tts-narrator](#readmemd) / AzureAudioGenerationOptions | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarration_scriptnarrationparagraphmd) | | ||
### Interface: AzureAudioGenerationOptions | ||
###### Returns | ||
#### Hierarchy | ||
`Promise`\<`string`\> | ||
- [`AudioGenerationOptions`](#interfacesaudiogenerationoptionsmd) | ||
## Modules | ||
↳ **`AzureAudioGenerationOptions`** | ||
#### Table of contents | ||
<a name="modulesaudio_utilsmd"></a> | ||
##### Properties | ||
### Module: audio-utils | ||
- [outputFilePath](#outputfilepath) | ||
- [serviceRegion](#serviceregion) | ||
- [subscriptionKey](#subscriptionkey) | ||
#### Functions | ||
#### Properties | ||
##### getAudioFileDuration | ||
##### outputFilePath | ||
▸ **getAudioFileDuration**(`filePath`): `Promise`\<`number`\> | ||
• **outputFilePath**: `string` | ||
###### Parameters | ||
###### Inherited from | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `filePath` | `string` | | ||
[AudioGenerationOptions](#interfacesaudiogenerationoptionsmd).[outputFilePath](#outputfilepath) | ||
###### Returns | ||
`Promise`\<`number`\> | ||
___ | ||
##### serviceRegion | ||
##### playMp3File | ||
• `Optional` **serviceRegion**: `string` | ||
▸ **playMp3File**(`filePath`, `infoLogger`): `Promise`\<`void`\> | ||
___ | ||
###### Parameters | ||
##### subscriptionKey | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `filePath` | `string` | | ||
| `infoLogger` | (`msg`: `string`) => `void` | | ||
• `Optional` **subscriptionKey**: `string` | ||
###### Returns | ||
`Promise`\<`void`\> | ||
<a name="interfacesnarrationscriptfilechaptermd"></a> | ||
[tts-narrator](#readmemd) / [NarrationScriptFile](#modulesnarrationscriptfilemd) / Chapter | ||
<a name="modulesazure_tts_servicemd"></a> | ||
### Interface: Chapter | ||
### Module: azure-tts-service | ||
[NarrationScriptFile](#modulesnarrationscriptfilemd).Chapter | ||
#### Classes | ||
#### Implemented by | ||
- [AzureTtsService](#classesazure_tts_serviceazurettsservicemd) | ||
- [`NarrationChapter`](#classesnarrationchaptermd) | ||
#### Interfaces | ||
#### Table of contents | ||
- [AzureAudioGenerationOptions](#interfacesazure_tts_serviceazureaudiogenerationoptionsmd) | ||
##### Properties | ||
- [key](#key) | ||
- [sections](#sections) | ||
- [settings](#settings) | ||
<a name="modulesindexmd"></a> | ||
#### Properties | ||
### Module: index | ||
##### key | ||
#### Classes | ||
• `Optional` **key**: `string` | ||
- [export=](#classesindexexport_md) | ||
___ | ||
##### sections | ||
<a name="modulesnarration_scriptnarrationscriptfilemd"></a> | ||
• **sections**: [`Section`](#interfacesnarrationscriptfilesectionmd)[] | ||
### Namespace: NarrationScriptFile | ||
___ | ||
[narration-script](#modulesnarration_scriptmd).NarrationScriptFile | ||
##### settings | ||
#### Interfaces | ||
• `Optional` **settings**: [`VoiceSettings`](#interfacesvoicesettingsmd) | ||
- [Chapter](#interfacesnarration_scriptnarrationscriptfilechaptermd) | ||
- [Paragraph](#interfacesnarration_scriptnarrationscriptfileparagraphmd) | ||
- [Script](#interfacesnarration_scriptnarrationscriptfilescriptmd) | ||
- [Section](#interfacesnarration_scriptnarrationscriptfilesectionmd) | ||
<a name="interfacesnarrationscriptfileparagraphmd"></a> | ||
<a name="modulesnarration_scriptmd"></a> | ||
[tts-narrator](#readmemd) / [NarrationScriptFile](#modulesnarrationscriptfilemd) / Paragraph | ||
### Module: narration-script | ||
### Interface: Paragraph | ||
#### Namespaces | ||
[NarrationScriptFile](#modulesnarrationscriptfilemd).Paragraph | ||
- [NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd) | ||
#### Implemented by | ||
#### Classes | ||
- [`NarrationParagraph`](#classesnarrationparagraphmd) | ||
- [NarrationChapter](#classesnarration_scriptnarrationchaptermd) | ||
- [NarrationParagraph](#classesnarration_scriptnarrationparagraphmd) | ||
- [NarrationScript](#classesnarration_scriptnarrationscriptmd) | ||
- [NarrationSection](#classesnarration_scriptnarrationsectionmd) | ||
#### Table of contents | ||
#### Interfaces | ||
##### Properties | ||
- [ScriptSettings](#interfacesnarration_scriptscriptsettingsmd) | ||
- [VoiceSettings](#interfacesnarration_scriptvoicesettingsmd) | ||
- [key](#key) | ||
- [settings](#settings) | ||
- [text](#text) | ||
#### Functions | ||
#### Properties | ||
##### loadScript | ||
##### key | ||
▸ **loadScript**(`scriptFilePath`): `Promise`\<[`NarrationScript`](#classesnarration_scriptnarrationscriptmd)\> | ||
• `Optional` **key**: `string` | ||
###### Parameters | ||
___ | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `scriptFilePath` | `string` | | ||
##### settings | ||
###### Returns | ||
• `Optional` **settings**: [`VoiceSettings`](#interfacesvoicesettingsmd) | ||
`Promise`\<[`NarrationScript`](#classesnarration_scriptnarrationscriptmd)\> | ||
___ | ||
##### text | ||
##### saveScript | ||
• **text**: `string` | ||
▸ **saveScript**(`script`): `Promise`\<`void`\> | ||
###### Parameters | ||
<a name="interfacesnarrationscriptfilescriptmd"></a> | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `script` | [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | ||
[tts-narrator](#readmemd) / [NarrationScriptFile](#modulesnarrationscriptfilemd) / Script | ||
###### Returns | ||
### Interface: Script | ||
`Promise`\<`void`\> | ||
[NarrationScriptFile](#modulesnarrationscriptfilemd).Script | ||
▸ **saveScript**(`script`, `scriptFilePath`): `Promise`\<`void`\> | ||
#### Implemented by | ||
###### Parameters | ||
- [`NarrationScript`](#classesnarrationscriptmd) | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `script` | [`Script`](#interfacesnarration_scriptnarrationscriptfilescriptmd) | | ||
| `scriptFilePath` | `string` | | ||
#### Table of contents | ||
###### Returns | ||
##### Properties | ||
`Promise`\<`void`\> | ||
- [chapters](#chapters) | ||
- [settings](#settings) | ||
#### Properties | ||
<a name="modulesscript_processormd"></a> | ||
##### chapters | ||
### Module: script-processor | ||
• **chapters**: [`Chapter`](#interfacesnarrationscriptfilechaptermd)[] | ||
#### Enumerations | ||
___ | ||
- [TtsServiceType](#enumsscript_processorttsservicetypemd) | ||
##### settings | ||
#### Classes | ||
• **settings**: [`ScriptSettings`](#interfacesscriptsettingsmd) | ||
- [ScriptProcessor](#classesscript_processorscriptprocessormd) | ||
#### Variables | ||
<a name="interfacesnarrationscriptfilesectionmd"></a> | ||
##### scriptProcessorFlags | ||
[tts-narrator](#readmemd) / [NarrationScriptFile](#modulesnarrationscriptfilemd) / Section | ||
• `Const` **scriptProcessorFlags**: `Object` | ||
### Interface: Section | ||
CLI flags that are required/used by the ScriptProcessor. | ||
[NarrationScriptFile](#modulesnarrationscriptfilemd).Section | ||
###### Type declaration | ||
#### Implemented by | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `chapters` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> | | ||
| `debug` | `BooleanFlag`\<`boolean`\> | | ||
| `dry-run` | `BooleanFlag`\<`boolean`\> | | ||
| `interactive` | `BooleanFlag`\<`boolean`\> | | ||
| `overwrite` | `BooleanFlag`\<`boolean`\> | | ||
| `play` | `BooleanFlag`\<`boolean`\> | | ||
| `quiet` | `BooleanFlag`\<`boolean`\> | | ||
| `region` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> | | ||
| `sections` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> | | ||
| `service` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> | | ||
| `ssml` | `BooleanFlag`\<`boolean`\> | | ||
| `subscription-key` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> | | ||
| `subscription-key-env` | `OptionFlag`\<`undefined` \| `string`, `CustomOptions`\> | | ||
- [`NarrationSection`](#classesnarrationsectionmd) | ||
#### Table of contents | ||
<a name="modulestts_servicemd"></a> | ||
##### Properties | ||
### Module: tts-service | ||
- [key](#key) | ||
- [paragraphs](#paragraphs) | ||
- [settings](#settings) | ||
#### Classes | ||
#### Properties | ||
- [BaseTtsService](#classestts_servicebasettsservicemd) | ||
##### key | ||
#### Interfaces | ||
• `Optional` **key**: `string` | ||
- [AudioGenerationOptions](#interfacestts_serviceaudiogenerationoptionsmd) | ||
- [TtsService](#interfacestts_servicettsservicemd) | ||
___ | ||
##### paragraphs | ||
<a name="modulestypesmd"></a> | ||
• **paragraphs**: [`Paragraph`](#interfacesnarrationscriptfileparagraphmd)[] | ||
### Module: types | ||
___ | ||
#### References | ||
##### settings | ||
##### AudioGenerationOptions | ||
• `Optional` **settings**: [`VoiceSettings`](#interfacesvoicesettingsmd) | ||
Re-exports [AudioGenerationOptions](#interfacestts_serviceaudiogenerationoptionsmd) | ||
___ | ||
<a name="interfacesscriptsettingsmd"></a> | ||
##### AzureAudioGenerationOptions | ||
[tts-narrator](#readmemd) / ScriptSettings | ||
Re-exports [AzureAudioGenerationOptions](#interfacesazure_tts_serviceazureaudiogenerationoptionsmd) | ||
### Interface: ScriptSettings | ||
___ | ||
#### Table of contents | ||
##### AzureTtsService | ||
##### Properties | ||
Re-exports [AzureTtsService](#classesazure_tts_serviceazurettsservicemd) | ||
- [service](#service) | ||
- [voice](#voice) | ||
___ | ||
#### Properties | ||
##### BaseTtsService | ||
##### service | ||
Re-exports [BaseTtsService](#classestts_servicebasettsservicemd) | ||
• `Optional` **service**: [`Azure`](#azure) | ||
___ | ||
##### voice | ||
##### NarrationChapter | ||
• `Optional` **voice**: [`VoiceSettings`](#interfacesvoicesettingsmd) | ||
Re-exports [NarrationChapter](#classesnarration_scriptnarrationchaptermd) | ||
___ | ||
<a name="interfacesttsservicemd"></a> | ||
##### NarrationParagraph | ||
[tts-narrator](#readmemd) / TtsService | ||
Re-exports [NarrationParagraph](#classesnarration_scriptnarrationparagraphmd) | ||
### Interface: TtsService | ||
___ | ||
#### Implemented by | ||
##### NarrationScript | ||
- [`BaseTtsService`](#classesbasettsservicemd) | ||
Re-exports [NarrationScript](#classesnarration_scriptnarrationscriptmd) | ||
#### Table of contents | ||
___ | ||
##### Methods | ||
##### NarrationScriptFile | ||
- [generateAudio](#generateaudio) | ||
- [generateSSML](#generatessml) | ||
Re-exports [NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd) | ||
#### Methods | ||
___ | ||
##### generateAudio | ||
##### NarrationSection | ||
▸ **generateAudio**(`ssml`, `options`): `Promise`<`void`\> | ||
Re-exports [NarrationSection](#classesnarration_scriptnarrationsectionmd) | ||
###### Parameters | ||
___ | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `ssml` | `string` | | ||
| `options` | [`AudioGenerationOptions`](#interfacesaudiogenerationoptionsmd) | | ||
##### ScriptProcessor | ||
###### Returns | ||
Re-exports [ScriptProcessor](#classesscript_processorscriptprocessormd) | ||
`Promise`<`void`\> | ||
___ | ||
##### generateSSML | ||
##### ScriptSettings | ||
▸ **generateSSML**(`paragraph`): `Promise`<`string`\> | ||
Re-exports [ScriptSettings](#interfacesnarration_scriptscriptsettingsmd) | ||
###### Parameters | ||
___ | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `paragraph` | [`NarrationParagraph`](#classesnarrationparagraphmd) | | ||
##### TtsService | ||
###### Returns | ||
Re-exports [TtsService](#interfacestts_servicettsservicemd) | ||
`Promise`<`string`\> | ||
___ | ||
##### TtsServiceType | ||
<a name="interfacesvoicesettingsmd"></a> | ||
Re-exports [TtsServiceType](#enumsscript_processorttsservicetypemd) | ||
[tts-narrator](#readmemd) / VoiceSettings | ||
___ | ||
### Interface: VoiceSettings | ||
##### VoiceSettings | ||
#### Table of contents | ||
Re-exports [VoiceSettings](#interfacesnarration_scriptvoicesettingsmd) | ||
##### Properties | ||
___ | ||
- [language](#language) | ||
- [name](#name) | ||
##### getAudioFileDuration | ||
#### Properties | ||
Re-exports [getAudioFileDuration](#getaudiofileduration) | ||
##### language | ||
___ | ||
• `Optional` **language**: `string` | ||
##### loadScript | ||
Re-exports [loadScript](#loadscript) | ||
___ | ||
##### name | ||
##### playMp3File | ||
• `Optional` **name**: `string` | ||
Re-exports [playMp3File](#playmp3file) | ||
## Modules | ||
___ | ||
##### saveScript | ||
<a name="modulesnarrationscriptfilemd"></a> | ||
Re-exports [saveScript](#savescript) | ||
[tts-narrator](#readmemd) / NarrationScriptFile | ||
___ | ||
### Namespace: NarrationScriptFile | ||
##### scriptProcessorFlags | ||
#### Table of contents | ||
##### Interfaces | ||
- [Chapter](#interfacesnarrationscriptfilechaptermd) | ||
- [Paragraph](#interfacesnarrationscriptfileparagraphmd) | ||
- [Script](#interfacesnarrationscriptfilescriptmd) | ||
- [Section](#interfacesnarrationscriptfilesectionmd) | ||
Re-exports [scriptProcessorFlags](#scriptprocessorflags) | ||
<!-- API end --> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
88584
12
8
1
715
1424
+ Added@handy-common-utils/fs-utils@1.1.1(transitive)
+ Added@handy-common-utils/misc-utils@1.5.2(transitive)
+ Added@handy-common-utils/oclif-utils@2.1.0(transitive)
+ Added@oclif/core@4.0.6(transitive)
+ Addedansis@3.2.0(transitive)
+ Addedcli-spinners@2.9.2(transitive)
+ Addedfast-xml-parser@4.4.0(transitive)
+ Addedlilconfig@3.1.2(transitive)
+ Addedminimatch@9.0.4(transitive)
+ Addedmulti-integer-range@5.2.0(transitive)
- Removed@oclif/command@^1.8.0
- Removed@oclif/config@^1.17.0
- Removed@oclif/plugin-help@^3.2.3
- Removed@cspotcode/source-map-support@0.8.1(transitive)
- Removed@handy-common-utils/oclif-utils@1.1.3(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/sourcemap-codec@1.4.15(transitive)
- Removed@jridgewell/trace-mapping@0.3.9(transitive)
- Removed@oclif/command@1.8.36(transitive)
- Removed@oclif/config@1.18.161.18.171.18.2(transitive)
- Removed@oclif/core@2.16.0(transitive)
- Removed@oclif/errors@1.3.51.3.6(transitive)
- Removed@oclif/help@1.0.15(transitive)
- Removed@oclif/linewrap@1.0.0(transitive)
- Removed@oclif/parser@3.8.17(transitive)
- Removed@oclif/plugin-help@3.3.1(transitive)
- Removed@tsconfig/node10@1.0.11(transitive)
- Removed@tsconfig/node12@1.0.11(transitive)
- Removed@tsconfig/node14@1.0.3(transitive)
- Removed@tsconfig/node16@1.0.4(transitive)
- Removed@types/cli-progress@3.11.5(transitive)
- Removed@types/node@20.14.6(transitive)
- Removedacorn@8.12.0(transitive)
- Removedacorn-walk@8.3.3(transitive)
- Removedansicolors@0.3.2(transitive)
- Removedarg@4.1.3(transitive)
- Removedargparse@1.0.10(transitive)
- Removedastral-regex@2.0.0(transitive)
- Removedat-least-node@1.0.0(transitive)
- Removedcardinal@2.1.1(transitive)
- Removedcli-progress@3.12.0(transitive)
- Removedcreate-require@1.1.1(transitive)
- Removedcross-spawn@7.0.3(transitive)
- Removeddiff@4.0.2(transitive)
- Removedesprima@4.0.1(transitive)
- Removedfast-xml-parser@3.21.1(transitive)
- Removedfs-extra@8.1.09.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhyperlinker@1.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjsonfile@4.0.06.1.0(transitive)
- Removedmake-error@1.3.6(transitive)
- Removedmulti-integer-range@4.0.9(transitive)
- Removednatural-orderby@2.0.3(transitive)
- Removedobject-treeify@1.1.33(transitive)
- Removedpassword-prompt@1.1.3(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedredeyed@2.1.1(transitive)
- Removedsemver@7.6.2(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedslice-ansi@4.0.0(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedsupports-hyperlinks@2.3.0(transitive)
- Removedts-node@10.9.2(transitive)
- Removedtslib@2.6.3(transitive)
- Removedtypescript@5.4.5(transitive)
- Removedundici-types@5.26.5(transitive)
- Removeduniversalify@0.1.22.0.1(transitive)
- Removedv8-compile-cache-lib@3.0.1(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwrap-ansi@6.2.0(transitive)
- Removedyn@3.1.1(transitive)
Updatedfast-xml-parser@^4.3.5
Updatedmulti-integer-range@^5.2.0
Updatedmurmurhash@^2.0.1
Updatedprompts@^2.4.2