@readium/speech 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/build/SpeechServer/speechServerVoiceMapping.d.ts +2 -2
- package/build/SpeechServer/types.d.ts +2 -1
- package/build/index.cjs +27 -27
- package/build/index.js +653 -647
- package/build/preferences/SpeechDefaults.d.ts +3 -5
- package/build/preferences/SpeechPreferences.d.ts +3 -5
- package/build/preferences/SpeechPreferencesEditor.d.ts +2 -3
- package/build/preferences/SpeechSettings.d.ts +2 -3
- package/build/preferences/constraints.d.ts +2 -2
- package/build/speechNavigator.d.ts +2 -0
- package/build/utterance.d.ts +0 -1
- package/build/utterances/extractUtterances.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GndRole } from '../gnd/types.js';
|
|
2
|
-
import { ExtractionFormat, LanguageMode,
|
|
2
|
+
import { AutoPauseScope, ExtractionFormat, LanguageMode, VerbosityPreset } from './SpeechPreferences.js';
|
|
3
3
|
export interface ISpeechDefaults {
|
|
4
4
|
format?: ExtractionFormat | null;
|
|
5
5
|
inlineContextualization?: boolean | null;
|
|
@@ -8,8 +8,7 @@ export interface ISpeechDefaults {
|
|
|
8
8
|
contextualize?: GndRole[] | null;
|
|
9
9
|
language?: LanguageMode | null;
|
|
10
10
|
pauseDuration?: number | null;
|
|
11
|
-
|
|
12
|
-
automaticPausesAtPageOrSpreadEnd?: boolean | null;
|
|
11
|
+
autoPause?: AutoPauseScope | null;
|
|
13
12
|
rate?: number | null;
|
|
14
13
|
pitch?: number | null;
|
|
15
14
|
volume?: number | null;
|
|
@@ -22,8 +21,7 @@ export declare class SpeechDefaults {
|
|
|
22
21
|
readonly contextualize: GndRole[];
|
|
23
22
|
readonly language: LanguageMode;
|
|
24
23
|
readonly pauseDuration: number;
|
|
25
|
-
readonly
|
|
26
|
-
readonly automaticPausesAtPageOrSpreadEnd: boolean;
|
|
24
|
+
readonly autoPause: AutoPauseScope;
|
|
27
25
|
readonly rate: number;
|
|
28
26
|
readonly pitch: number;
|
|
29
27
|
readonly volume: number;
|
|
@@ -3,7 +3,7 @@ import { ConfigurablePreferences } from './Configurable.js';
|
|
|
3
3
|
export type VerbosityPreset = "none" | "few" | "some" | "most" | "custom";
|
|
4
4
|
export type LanguageMode = "none" | "block-level" | "always";
|
|
5
5
|
export type ExtractionFormat = "plain" | "ssml";
|
|
6
|
-
export type
|
|
6
|
+
export type AutoPauseScope = "none" | "utterance" | "block";
|
|
7
7
|
export interface ISpeechPreferences {
|
|
8
8
|
format?: ExtractionFormat | null;
|
|
9
9
|
inlineContextualization?: boolean | null;
|
|
@@ -12,8 +12,7 @@ export interface ISpeechPreferences {
|
|
|
12
12
|
contextualize?: GndRole[] | null;
|
|
13
13
|
language?: LanguageMode | null;
|
|
14
14
|
pauseDuration?: number | null;
|
|
15
|
-
|
|
16
|
-
automaticPausesAtPageOrSpreadEnd?: boolean | null;
|
|
15
|
+
autoPause?: AutoPauseScope | null;
|
|
17
16
|
rate?: number | null;
|
|
18
17
|
pitch?: number | null;
|
|
19
18
|
volume?: number | null;
|
|
@@ -26,8 +25,7 @@ export declare class SpeechPreferences implements ISpeechPreferences, Configurab
|
|
|
26
25
|
contextualize: GndRole[] | null | undefined;
|
|
27
26
|
language: LanguageMode | null | undefined;
|
|
28
27
|
pauseDuration: number | null | undefined;
|
|
29
|
-
|
|
30
|
-
automaticPausesAtPageOrSpreadEnd: boolean | null | undefined;
|
|
28
|
+
autoPause: AutoPauseScope | null | undefined;
|
|
31
29
|
rate: number | null | undefined;
|
|
32
30
|
pitch: number | null | undefined;
|
|
33
31
|
volume: number | null | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPreferencesEditor } from './PreferencesEditor.js';
|
|
2
2
|
import { BooleanPreference, EnumPreference, RangePreference, StringArrayPreference } from './Preference.js';
|
|
3
|
-
import { SpeechPreferences, VerbosityPreset, LanguageMode, ExtractionFormat,
|
|
3
|
+
import { SpeechPreferences, VerbosityPreset, LanguageMode, ExtractionFormat, AutoPauseScope } from './SpeechPreferences.js';
|
|
4
4
|
import { SpeechSettings } from './SpeechSettings.js';
|
|
5
5
|
export declare class SpeechPreferencesEditor implements IPreferencesEditor {
|
|
6
6
|
preferences: SpeechPreferences;
|
|
@@ -15,8 +15,7 @@ export declare class SpeechPreferencesEditor implements IPreferencesEditor {
|
|
|
15
15
|
get contextualize(): StringArrayPreference;
|
|
16
16
|
get language(): EnumPreference<LanguageMode>;
|
|
17
17
|
get pauseDuration(): RangePreference<number>;
|
|
18
|
-
get
|
|
19
|
-
get automaticPausesAtPageOrSpreadEnd(): BooleanPreference;
|
|
18
|
+
get autoPause(): EnumPreference<AutoPauseScope>;
|
|
20
19
|
get rate(): RangePreference<number>;
|
|
21
20
|
get pitch(): RangePreference<number>;
|
|
22
21
|
get volume(): RangePreference<number>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GndRole } from '../gnd/types.js';
|
|
2
2
|
import { ConfigurableSettings } from './Configurable.js';
|
|
3
3
|
import { SpeechDefaults } from './SpeechDefaults.js';
|
|
4
|
-
import { ExtractionFormat, LanguageMode,
|
|
4
|
+
import { AutoPauseScope, ExtractionFormat, LanguageMode, SpeechPreferences, VerbosityPreset } from './SpeechPreferences.js';
|
|
5
5
|
export declare class SpeechSettings implements ConfigurableSettings {
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
readonly format: ExtractionFormat;
|
|
@@ -11,8 +11,7 @@ export declare class SpeechSettings implements ConfigurableSettings {
|
|
|
11
11
|
readonly contextualize: GndRole[];
|
|
12
12
|
readonly language: LanguageMode;
|
|
13
13
|
readonly pauseDuration: number;
|
|
14
|
-
readonly
|
|
15
|
-
readonly automaticPausesAtPageOrSpreadEnd: boolean;
|
|
14
|
+
readonly autoPause: AutoPauseScope;
|
|
16
15
|
readonly rate: number;
|
|
17
16
|
readonly pitch: number;
|
|
18
17
|
readonly volume: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtractionFormat, ISpeechPreferences, LanguageMode,
|
|
1
|
+
import { AutoPauseScope, ExtractionFormat, ISpeechPreferences, LanguageMode, VerbosityPreset } from './SpeechPreferences.js';
|
|
2
2
|
export interface RangeConfig {
|
|
3
3
|
range: [number, number];
|
|
4
4
|
step: number;
|
|
@@ -10,5 +10,5 @@ export declare const volumeRangeConfig: RangeConfig;
|
|
|
10
10
|
export declare const verbosityPresets: VerbosityPreset[];
|
|
11
11
|
export declare const languageModes: LanguageMode[];
|
|
12
12
|
export declare const extractionFormats: ExtractionFormat[];
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const autoPauseScopes: AutoPauseScope[];
|
|
14
14
|
export declare const extractionPreferenceKeys: (keyof ISpeechPreferences)[];
|
|
@@ -23,8 +23,10 @@ export declare class ReadiumSpeechNavigator implements ReadiumSpeechNavigatorCon
|
|
|
23
23
|
private _preferencesEditor;
|
|
24
24
|
private source;
|
|
25
25
|
private contentSources;
|
|
26
|
+
private contentBlockStarts;
|
|
26
27
|
private pendingResumeIndex;
|
|
27
28
|
private pendingResumeState;
|
|
29
|
+
private pendingAutoPauseIndex;
|
|
28
30
|
constructor(engine: ReadiumSpeechPlaybackEngine, configuration?: ReadiumSpeechNavigatorConfiguration);
|
|
29
31
|
private applyEngineParameters;
|
|
30
32
|
private initializeEngine;
|
package/build/utterance.d.ts
CHANGED
|
@@ -11,9 +11,11 @@ import { ExtractUtterancesOptions } from './types.js';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function extractUtterances(nodes: GndObject[], options: ExtractUtterancesOptions): ReadiumSpeechUtterance[];
|
|
13
13
|
/**
|
|
14
|
-
* Same as `extractUtterances()`, plus `sources[i]`: the node that produced `utterances[i]
|
|
14
|
+
* Same as `extractUtterances()`, plus `sources[i]`: the node that produced `utterances[i]`,
|
|
15
|
+
* and `blockStarts[i]`: whether `utterances[i]` begins a new block-level element.
|
|
15
16
|
*/
|
|
16
17
|
export declare function extractUtterancesWithSources(nodes: GndObject[], options: ExtractUtterancesOptions): {
|
|
17
18
|
utterances: ReadiumSpeechUtterance[];
|
|
18
19
|
sources: (GndObject | undefined)[];
|
|
20
|
+
blockStarts: boolean[];
|
|
19
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@readium/speech",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "A TypeScript library for implementing read aloud features with Web technologies, following best practices for digital publishing.",
|
|
5
5
|
"author": "Readium Foundation",
|
|
6
6
|
"keywords": [
|