tts-narrator
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -18,15 +18,16 @@ "use strict"; | ||
} | ||
let speakerClassOrError; | ||
// loaded class / undefined as not initialised / null as failed to load | ||
let _speakerClass; | ||
function getSpeakerClass(errorLogger) { | ||
if (!speakerClassOrError) { | ||
if (_speakerClass === undefined) { | ||
try { | ||
// eslint-disable-next-line unicorn/prefer-module | ||
speakerClassOrError = require('speaker'); | ||
_speakerClass = require('speaker'); | ||
} | ||
catch (error) { | ||
speakerClassOrError = `${error}`; | ||
errorLogger(`Library for playing MP3 is not available: ${speakerClassOrError}`); | ||
_speakerClass = null; | ||
errorLogger(`Library for playing MP3 is not available: ${error}`); | ||
} | ||
} | ||
return typeof speakerClassOrError === 'string' ? undefined : speakerClassOrError; | ||
return _speakerClass; | ||
} | ||
@@ -33,0 +34,0 @@ async function playMp3File(filePath, infoLogger) { |
@@ -1,30 +0,6 @@ | ||
import { Command } from '@oclif/core'; | ||
declare class TtsNarratorCli extends Command { | ||
static id: string; | ||
static description: string; | ||
static flags: { | ||
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: { | ||
file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>; | ||
}; | ||
static examples: string[]; | ||
run(): Promise<void>; | ||
} | ||
export = TtsNarratorCli; | ||
export * from './tts-service'; | ||
export * from './narration-script'; | ||
export * from './azure-tts-service'; | ||
export * from './audio-utils'; | ||
export * from './script-processor'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
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 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_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 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; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./tts-service"), exports); | ||
tslib_1.__exportStar(require("./narration-script"), exports); | ||
tslib_1.__exportStar(require("./azure-tts-service"), exports); | ||
tslib_1.__exportStar(require("./audio-utils"), exports); | ||
tslib_1.__exportStar(require("./script-processor"), exports); |
@@ -1,2 +0,2 @@ | ||
import { TtsServiceType } from './script-processor'; | ||
import { TtsServiceType } from './tts-service'; | ||
export interface VoiceSettings { | ||
@@ -3,0 +3,0 @@ name?: string; |
@@ -0,32 +1,13 @@ | ||
import type chalkType from 'chalk'; | ||
import type promptsFunc from 'prompts'; | ||
import { ConsoleLineLogger } from '@handy-common-utils/misc-utils'; | ||
import { CommandOptions } from '@handy-common-utils/oclif-utils'; | ||
import { MultiRange } from 'multi-integer-range'; | ||
import type { ScriptProcessorFlags } from './script-processor-flags'; | ||
import { NarrationParagraph, NarrationScript } from './narration-script'; | ||
import { AudioGenerationOptions, TtsService } from './tts-service'; | ||
export declare enum TtsServiceType { | ||
Azure = "azure" | ||
} | ||
/** | ||
* CLI flags that are required/used by the ScriptProcessor. | ||
*/ | ||
export declare const scriptProcessorFlags: { | ||
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: CommandOptions<{ | ||
flags: typeof scriptProcessorFlags; | ||
}>['flags']; | ||
protected flags: ScriptProcessorFlags; | ||
protected _prompts: typeof promptsFunc | undefined | null; | ||
protected _chalk: typeof chalkType | undefined | null; | ||
protected cliConsole: ConsoleLineLogger; | ||
@@ -38,5 +19,11 @@ protected ttsService: TtsService; | ||
protected sectionRange: MultiRange | undefined; | ||
constructor(scriptFilePath: string, flags: CommandOptions<{ | ||
flags: typeof scriptProcessorFlags; | ||
}>['flags'], cliConsole?: ConsoleLineLogger); | ||
constructor(scriptFilePath: string, flags: ScriptProcessorFlags, cliConsole?: ConsoleLineLogger); | ||
/** | ||
* prompts function, or null caused by library not available | ||
*/ | ||
protected get prompts(): typeof promptsFunc | null | undefined; | ||
/** | ||
* chalk, or null caused by library not available | ||
*/ | ||
protected get chalk(): typeof promptsFunc | null | undefined; | ||
protected hash(ssml: string, _paragraph: NarrationParagraph): string; | ||
@@ -43,0 +30,0 @@ protected loadScript(): Promise<void>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ScriptProcessor = exports.scriptProcessorFlags = exports.TtsServiceType = void 0; | ||
exports.ScriptProcessor = void 0; | ||
const tslib_1 = require("tslib"); | ||
/* eslint-disable complexity */ | ||
/* eslint-disable no-await-in-loop */ | ||
/* eslint-disable max-depth */ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
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"); | ||
@@ -16,29 +10,6 @@ const murmurhash = tslib_1.__importStar(require("murmurhash")); | ||
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"); | ||
var TtsServiceType; | ||
(function (TtsServiceType) { | ||
TtsServiceType["Azure"] = "azure"; | ||
})(TtsServiceType || (exports.TtsServiceType = TtsServiceType = {})); | ||
/** | ||
* 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(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-"' }), | ||
}; | ||
const tts_service_1 = require("./tts-service"); | ||
class ScriptProcessor { | ||
@@ -48,4 +19,36 @@ constructor(scriptFilePath, flags, cliConsole) { | ||
this.flags = flags; | ||
this.cliConsole = cliConsole !== null && cliConsole !== void 0 ? cliConsole : (0, misc_utils_1.consoleWithColour)(this.flags, chalk_1.default); | ||
this.cliConsole = cliConsole !== null && cliConsole !== void 0 ? cliConsole : (this.chalk ? (0, misc_utils_1.consoleWithColour)(this.flags, this.chalk) : (0, misc_utils_1.consoleWithoutColour)(this.flags)); | ||
} | ||
/** | ||
* prompts function, or null caused by library not available | ||
*/ | ||
get prompts() { | ||
if (this._prompts === undefined) { | ||
try { | ||
// eslint-disable-next-line unicorn/prefer-module | ||
this._prompts = require('prompts'); | ||
} | ||
catch (error) { | ||
this._prompts = null; | ||
this.cliConsole.error(`Library for prompting user input is not available: ${error}`); | ||
} | ||
} | ||
return this._prompts; | ||
} | ||
/** | ||
* chalk, or null caused by library not available | ||
*/ | ||
get chalk() { | ||
if (this._chalk === undefined) { | ||
try { | ||
// eslint-disable-next-line unicorn/prefer-module | ||
this._chalk = require('chalk'); | ||
} | ||
catch (error) { | ||
this._chalk = null; | ||
this.cliConsole.debug(`Library for colourising console output is not available: ${error}`); | ||
} | ||
} | ||
return this._prompts; | ||
} | ||
hash(ssml, _paragraph) { | ||
@@ -84,3 +87,3 @@ const hashNumber = murmurhash.v3(ssml, 2894); | ||
switch (ttsServiceType) { | ||
case TtsServiceType.Azure: { | ||
case tts_service_1.TtsServiceType.Azure: { | ||
this.ttsService = new azure_tts_service_1.AzureTtsService(); | ||
@@ -138,4 +141,4 @@ this.audioGenerationOptions = { | ||
// wait for user key press if needed | ||
if (paragraphIndex === 1 && this.flags.interactive) { | ||
const response = await (0, prompts_1.default)({ | ||
if (paragraphIndex === 1 && this.flags.interactive && this.prompts) { | ||
const response = await this.prompts({ | ||
initial: true, | ||
@@ -142,0 +145,0 @@ message: `Press ENTER to continue or CTRL-C to abort => [${chapterIndex}-${sectionIndex}] ${section.key}`, |
@@ -9,2 +9,5 @@ import { NarrationParagraph, VoiceSettings } from './narration-script'; | ||
} | ||
export declare enum TtsServiceType { | ||
Azure = "azure" | ||
} | ||
export declare abstract class BaseTtsService implements TtsService { | ||
@@ -11,0 +14,0 @@ generateSSML(paragraph: NarrationParagraph): Promise<string>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BaseTtsService = void 0; | ||
exports.BaseTtsService = exports.TtsServiceType = void 0; | ||
const fast_xml_parser_1 = require("fast-xml-parser"); | ||
var TtsServiceType; | ||
(function (TtsServiceType) { | ||
TtsServiceType["Azure"] = "azure"; | ||
})(TtsServiceType || (exports.TtsServiceType = TtsServiceType = {})); | ||
class BaseTtsService { | ||
@@ -6,0 +10,0 @@ async generateSSML(paragraph) { |
{ | ||
"name": "tts-narrator", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Generate narration with Text-To-Speech technology", | ||
"main": "dist/types.js", | ||
"types": "dist/types.d.ts", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"engines": { | ||
@@ -23,10 +23,7 @@ "node": ">=10" | ||
"@types/prompts": "^2.4.9", | ||
"oclif": "^4.10.5", | ||
"speaker": "^0.5.4" | ||
"oclif": "^4.10.5" | ||
}, | ||
"dependencies": { | ||
"@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": "^4.3.5", | ||
@@ -38,5 +35,10 @@ "js-yaml": "^4.1.0", | ||
"multi-integer-range": "^5.2.0", | ||
"murmurhash": "^2.0.1", | ||
"prompts": "^2.4.2" | ||
"murmurhash": "^2.0.1" | ||
}, | ||
"optionalDependencies": { | ||
"@handy-common-utils/oclif-utils": "^2.1.0", | ||
"chalk": "^4.1.2", | ||
"prompts": "^2.4.2", | ||
"speaker": "^0.5.5" | ||
}, | ||
"files": [ | ||
@@ -43,0 +45,0 @@ "bin", |
404
README.md
@@ -37,2 +37,8 @@ # tts-narrator | ||
To use the CLI as an NPM package, you need to install it with all its optional dependencies, like this: | ||
```shell | ||
npm i -g --include=optional tts-narrator | ||
``` | ||
<!-- help start --> | ||
@@ -75,3 +81,3 @@ ``` | ||
EXAMPLES | ||
$ tts-narrator myscript.yml --play --interactive --service azure --subscription-key-env SUBSCRIPTION_KEY --region australiaeast | ||
$ tts-narrator myscript.yml --play --interactive --service azure --subscription-key-env TTS_SUBSCRIPTION_KEY --region australiaeast | ||
@@ -101,4 +107,5 @@ $ tts-narrator ./test/fixtures/script3.yml -s azure --ssml -r australiaeast --subscription-key-env=TTS_SUB_KEY --no-play --interactive -d | ||
- [script-processor](#modulesscript_processormd) | ||
- [script-processor-flags](#modulesscript_processor_flagsmd) | ||
- [tts-narrator-cli](#modulestts_narrator_climd) | ||
- [tts-service](#modulestts_servicemd) | ||
- [types](#modulestypesmd) | ||
@@ -258,57 +265,2 @@ ## Classes | ||
<a name="classesindexexport_md"></a> | ||
### Class: export= | ||
[index](#modulesindexmd).export= | ||
#### Hierarchy | ||
- `Command` | ||
↳ **`export=`** | ||
#### Constructors | ||
##### constructor | ||
• **new export=**(`argv`, `config`) | ||
###### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `argv` | `string`[] | | ||
| `config` | `Config` | | ||
###### Inherited from | ||
Command.constructor | ||
#### Properties | ||
| 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 | | ||
#### Methods | ||
##### run | ||
▸ **run**(): `Promise`\<`void`\> | ||
###### Returns | ||
`Promise`\<`void`\> | ||
###### Overrides | ||
Command.run | ||
<a name="classesnarration_scriptnarrationchaptermd"></a> | ||
@@ -636,2 +588,4 @@ | ||
| --- | --- | | ||
| `Protected` **\_chalk**: `undefined` \| ``null`` \| `Chalk` & `ChalkFunction` & {} | | | ||
| `Protected` **\_prompts**: `undefined` \| ``null`` \| typeof `prompts` | | | ||
| `Protected` **\_script**: [`NarrationScript`](#classesnarration_scriptnarrationscriptmd) | | | ||
@@ -649,2 +603,26 @@ | `Protected` **audioGenerationOptions**: `undefined` \| [`AudioGenerationOptions`](#interfacestts_serviceaudiogenerationoptionsmd) | | | ||
##### chalk | ||
• `Protected` `get` **chalk**(): `undefined` \| ``null`` \| typeof `prompts` | ||
chalk, or null caused by library not available | ||
###### Returns | ||
`undefined` \| ``null`` \| typeof `prompts` | ||
___ | ||
##### prompts | ||
• `Protected` `get` **prompts**(): `undefined` \| ``null`` \| typeof `prompts` | ||
prompts function, or null caused by library not available | ||
###### Returns | ||
`undefined` \| ``null`` \| typeof `prompts` | ||
___ | ||
##### script | ||
@@ -771,2 +749,57 @@ | ||
<a name="classestts_narrator_cliexport_md"></a> | ||
### Class: export= | ||
[tts-narrator-cli](#modulestts_narrator_climd).export= | ||
#### Hierarchy | ||
- `Command` | ||
↳ **`export=`** | ||
#### Constructors | ||
##### constructor | ||
• **new export=**(`argv`, `config`) | ||
###### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `argv` | `string`[] | | ||
| `config` | `Config` | | ||
###### Inherited from | ||
Command.constructor | ||
#### Properties | ||
| 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 | | ||
#### Methods | ||
##### run | ||
▸ **run**(): `Promise`\<`void`\> | ||
###### Returns | ||
`Promise`\<`void`\> | ||
###### Overrides | ||
Command.run | ||
<a name="classestts_servicebasettsservicemd"></a> | ||
@@ -908,7 +941,7 @@ | ||
<a name="enumsscript_processorttsservicetypemd"></a> | ||
<a name="enumstts_servicettsservicetypemd"></a> | ||
### Enumeration: TtsServiceType | ||
[script-processor](#modulesscript_processormd).TtsServiceType | ||
[tts-service](#modulestts_servicemd).TtsServiceType | ||
@@ -1176,7 +1209,111 @@ #### Enumeration Members | ||
#### Classes | ||
#### References | ||
- [export=](#classesindexexport_md) | ||
##### AudioGenerationOptions | ||
Re-exports [AudioGenerationOptions](#interfacestts_serviceaudiogenerationoptionsmd) | ||
___ | ||
##### AzureAudioGenerationOptions | ||
Re-exports [AzureAudioGenerationOptions](#interfacesazure_tts_serviceazureaudiogenerationoptionsmd) | ||
___ | ||
##### AzureTtsService | ||
Re-exports [AzureTtsService](#classesazure_tts_serviceazurettsservicemd) | ||
___ | ||
##### BaseTtsService | ||
Re-exports [BaseTtsService](#classestts_servicebasettsservicemd) | ||
___ | ||
##### NarrationChapter | ||
Re-exports [NarrationChapter](#classesnarration_scriptnarrationchaptermd) | ||
___ | ||
##### NarrationParagraph | ||
Re-exports [NarrationParagraph](#classesnarration_scriptnarrationparagraphmd) | ||
___ | ||
##### NarrationScript | ||
Re-exports [NarrationScript](#classesnarration_scriptnarrationscriptmd) | ||
___ | ||
##### NarrationScriptFile | ||
Re-exports [NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd) | ||
___ | ||
##### NarrationSection | ||
Re-exports [NarrationSection](#classesnarration_scriptnarrationsectionmd) | ||
___ | ||
##### ScriptProcessor | ||
Re-exports [ScriptProcessor](#classesscript_processorscriptprocessormd) | ||
___ | ||
##### ScriptSettings | ||
Re-exports [ScriptSettings](#interfacesnarration_scriptscriptsettingsmd) | ||
___ | ||
##### TtsService | ||
Re-exports [TtsService](#interfacestts_servicettsservicemd) | ||
___ | ||
##### TtsServiceType | ||
Re-exports [TtsServiceType](#enumstts_servicettsservicetypemd) | ||
___ | ||
##### VoiceSettings | ||
Re-exports [VoiceSettings](#interfacesnarration_scriptvoicesettingsmd) | ||
___ | ||
##### getAudioFileDuration | ||
Re-exports [getAudioFileDuration](#getaudiofileduration) | ||
___ | ||
##### loadScript | ||
Re-exports [loadScript](#loadscript) | ||
___ | ||
##### playMp3File | ||
Re-exports [playMp3File](#playmp3file) | ||
___ | ||
##### saveScript | ||
Re-exports [saveScript](#savescript) | ||
<a name="modulesnarration_scriptnarrationscriptfilemd"></a> | ||
@@ -1266,6 +1403,2 @@ | ||
#### Enumerations | ||
- [TtsServiceType](#enumsscript_processorttsservicetypemd) | ||
#### Classes | ||
@@ -1275,2 +1408,13 @@ | ||
<a name="modulesscript_processor_flagsmd"></a> | ||
### Module: script-processor-flags | ||
#### Type Aliases | ||
##### ScriptProcessorFlags | ||
Ƭ **ScriptProcessorFlags**: `CommandOptions`\<\{ `flags`: typeof [`scriptProcessorFlags`](#scriptprocessorflags-1) }\>[``"flags"``] | ||
#### Variables | ||
@@ -1303,133 +1447,27 @@ | ||
<a name="modulestts_servicemd"></a> | ||
<a name="modulestts_narrator_climd"></a> | ||
### Module: tts-service | ||
### Module: tts-narrator-cli | ||
#### Classes | ||
- [BaseTtsService](#classestts_servicebasettsservicemd) | ||
- [export=](#classestts_narrator_cliexport_md) | ||
#### Interfaces | ||
- [AudioGenerationOptions](#interfacestts_serviceaudiogenerationoptionsmd) | ||
- [TtsService](#interfacestts_servicettsservicemd) | ||
<a name="modulestts_servicemd"></a> | ||
### Module: tts-service | ||
<a name="modulestypesmd"></a> | ||
#### Enumerations | ||
### Module: types | ||
- [TtsServiceType](#enumstts_servicettsservicetypemd) | ||
#### References | ||
#### Classes | ||
##### AudioGenerationOptions | ||
- [BaseTtsService](#classestts_servicebasettsservicemd) | ||
Re-exports [AudioGenerationOptions](#interfacestts_serviceaudiogenerationoptionsmd) | ||
#### Interfaces | ||
___ | ||
##### AzureAudioGenerationOptions | ||
Re-exports [AzureAudioGenerationOptions](#interfacesazure_tts_serviceazureaudiogenerationoptionsmd) | ||
___ | ||
##### AzureTtsService | ||
Re-exports [AzureTtsService](#classesazure_tts_serviceazurettsservicemd) | ||
___ | ||
##### BaseTtsService | ||
Re-exports [BaseTtsService](#classestts_servicebasettsservicemd) | ||
___ | ||
##### NarrationChapter | ||
Re-exports [NarrationChapter](#classesnarration_scriptnarrationchaptermd) | ||
___ | ||
##### NarrationParagraph | ||
Re-exports [NarrationParagraph](#classesnarration_scriptnarrationparagraphmd) | ||
___ | ||
##### NarrationScript | ||
Re-exports [NarrationScript](#classesnarration_scriptnarrationscriptmd) | ||
___ | ||
##### NarrationScriptFile | ||
Re-exports [NarrationScriptFile](#modulesnarration_scriptnarrationscriptfilemd) | ||
___ | ||
##### NarrationSection | ||
Re-exports [NarrationSection](#classesnarration_scriptnarrationsectionmd) | ||
___ | ||
##### ScriptProcessor | ||
Re-exports [ScriptProcessor](#classesscript_processorscriptprocessormd) | ||
___ | ||
##### ScriptSettings | ||
Re-exports [ScriptSettings](#interfacesnarration_scriptscriptsettingsmd) | ||
___ | ||
##### TtsService | ||
Re-exports [TtsService](#interfacestts_servicettsservicemd) | ||
___ | ||
##### TtsServiceType | ||
Re-exports [TtsServiceType](#enumsscript_processorttsservicetypemd) | ||
___ | ||
##### VoiceSettings | ||
Re-exports [VoiceSettings](#interfacesnarration_scriptvoicesettingsmd) | ||
___ | ||
##### getAudioFileDuration | ||
Re-exports [getAudioFileDuration](#getaudiofileduration) | ||
___ | ||
##### loadScript | ||
Re-exports [loadScript](#loadscript) | ||
___ | ||
##### playMp3File | ||
Re-exports [playMp3File](#playmp3file) | ||
___ | ||
##### saveScript | ||
Re-exports [saveScript](#savescript) | ||
___ | ||
##### scriptProcessorFlags | ||
Re-exports [scriptProcessorFlags](#scriptprocessorflags) | ||
- [AudioGenerationOptions](#interfacestts_serviceaudiogenerationoptionsmd) | ||
- [TtsService](#interfacestts_servicettsservicemd) | ||
<!-- 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
91784
7
29
759
1462
13
+ Addedspeaker@0.5.4(transitive)
- Removedchalk@^4.1.2
- Removedprompts@^2.4.2