echogarden 0.5.0 → 0.5.2
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 +35 -24
- package/data/lexicons/heteronyms.en.json +1 -1
- package/docs/CLI.md +7 -3
- package/docs/Development.md +12 -2
- package/docs/Engines.md +4 -4
- package/docs/Options.md +5 -1
- package/docs/Tasklist.md +289 -0
- package/docs/Technical.md +2 -2
- package/package.json +4 -6
- package/docs/Roadmap.md +0 -15
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Echogarden
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Echogarden is an integrated speech system that provides a range of speech generation, recognition and processing tools that are designed to be directly usable by end-users:
|
|
4
4
|
|
|
5
5
|
* Written in TypeScript, for the Node.js runtime
|
|
6
6
|
* Easy to install, run and update
|
|
@@ -12,32 +12,15 @@ A fully open-source speech system designed with end-users in mind.
|
|
|
12
12
|
|
|
13
13
|
* Fast, high-quality offline text-to-speech voices based on the [VITS](https://github.com/jaywalnut310/vits) neural architecture
|
|
14
14
|
* Accurate offline speech recognition using [OpenAI Whisper](https://openai.com/research/whisper) models
|
|
15
|
-
* Supports synthesis and recognition via
|
|
15
|
+
* Supports synthesis and recognition via a [variety of offline and cloud engines](docs/Engines.md), including Google, Microsoft and Amazon
|
|
16
16
|
* Word-level timestamps for all synthesis and recognition outputs
|
|
17
17
|
* Speech-to-transcript alignment using dynamic time warping (DTW), and dynamic time warping with recognition assist (DTW-RA) methods
|
|
18
18
|
* Advanced subtitle generation, accounting for sentence and phrase boundaries
|
|
19
|
-
* Can
|
|
19
|
+
* Can translate speech in any one of 98 languages, transcribe it directly to English, and produce near word-level synchronized subtitles for the translated transcript
|
|
20
20
|
* Attempts to improve TTS pronunciation accuracy for a few engines and languages (currently only implemented for English dialects): adds text normalization (e.g. idiomatic date and currency pronunciation), heteronym disambiguation (based on a custom rule-based model) and user-customizable pronunciation lexicons
|
|
21
21
|
* Internal package system that auto-downloads and installs voices, models and other resources, as needed
|
|
22
22
|
* Other features include: language detection (both for audio and text), voice activity detection, and speech denoising
|
|
23
23
|
|
|
24
|
-
### In development
|
|
25
|
-
|
|
26
|
-
* Background worker
|
|
27
|
-
* WebSocket-based server and API
|
|
28
|
-
* Browser extension (for TTS only), including integration with the Web Speech API, and an advanced page reader enabling real-time narration of any page content, with live word highlighting
|
|
29
|
-
* New, high-accuracy text language identification model (own work)
|
|
30
|
-
|
|
31
|
-
### Planned, but not yet
|
|
32
|
-
|
|
33
|
-
* Text enhancement, adding breaks to improve phrasing of synthesized text, as well as adding missing punctuation to recognized transcripts, if needed
|
|
34
|
-
* Web-based UI
|
|
35
|
-
* Real-time, streaming speech recognition
|
|
36
|
-
|
|
37
|
-
### Maybe
|
|
38
|
-
|
|
39
|
-
* Browser port for a subset of the API (in particular for the offline TTS models and their dependencies)
|
|
40
|
-
|
|
41
24
|
## Installation
|
|
42
25
|
|
|
43
26
|
Ensure you have [Node.js](https://nodejs.org/) `v16.0.0` or later installed.
|
|
@@ -48,7 +31,7 @@ npm install echogarden -g
|
|
|
48
31
|
```
|
|
49
32
|
|
|
50
33
|
Additional tools:
|
|
51
|
-
* [`sox`](https://sourceforge.net/projects/sox/): used for the CLI's audio playback and recording (only). Auto-installed via
|
|
34
|
+
* [`sox`](https://sourceforge.net/projects/sox/): used for the CLI's audio playback and recording (only). Auto-installed via an expansion package on Windows and Intel macOS. On Linux and ARM64 macOS, it is recommended to install it via platform package managers like `apt` and `brew`.
|
|
52
35
|
* [`ffmpeg`](https://ffmpeg.org/download.html): used for codec conversions. Auto-installed via an expansion package on Windows, Intel macOS, and x64 Linux. On ARM64 macOS, it is recommended to install it via platform package manager like `brew`, otherwise, much slower `ffmpeg-wasm` would be used.
|
|
53
36
|
|
|
54
37
|
(hopefully in the future all platforms would be covered using expansion packages)
|
|
@@ -59,15 +42,43 @@ Additional tools:
|
|
|
59
42
|
npm update echogarden -g
|
|
60
43
|
```
|
|
61
44
|
|
|
62
|
-
##
|
|
45
|
+
## Interfacing with the system
|
|
46
|
+
|
|
47
|
+
Currently, the software is operated mainly through a [command-line interface](docs/CLI.md), which enables powerful customization and is especially useful for long-running bulk operations.
|
|
48
|
+
|
|
49
|
+
Development of more graphical and interactive tooling is currently ongoing. A general roadmap is shown further down below.
|
|
50
|
+
|
|
51
|
+
## Guides and resource pages
|
|
63
52
|
|
|
64
|
-
* [Using the command
|
|
53
|
+
* [Using the command-line interface](docs/CLI.md)
|
|
65
54
|
* [Options reference](docs/Options.md)
|
|
66
55
|
* [Full list of supported engines](docs/Engines.md)
|
|
67
56
|
* [Technical overview and Q&A](docs/Technical.md)
|
|
68
|
-
* [
|
|
57
|
+
* [Developer's task list](docs/Tasklist.md)
|
|
69
58
|
* [How to help](docs/Development.md)
|
|
70
59
|
|
|
60
|
+
## Development roadmap
|
|
61
|
+
|
|
62
|
+
_(For much more detailed information, see the [developer task list](docs/Tasklist.md))_.
|
|
63
|
+
|
|
64
|
+
### In development
|
|
65
|
+
|
|
66
|
+
* (**90**%) Background worker
|
|
67
|
+
* (**90**%) WebSocket-based server and API
|
|
68
|
+
* (**70**%) Browser extension, acting as a bridge to a local or self-hosted server. Includes integration with the Web Speech API, and real-time narration of page content, with live word highlighting
|
|
69
|
+
* (**60**%) New, high-accuracy text language identification model (own work)
|
|
70
|
+
|
|
71
|
+
### Planned, but not yet started
|
|
72
|
+
|
|
73
|
+
* Web-based UI frontend
|
|
74
|
+
* Text enhancement, adding breaks to improve phrasing of synthesized text, as well as adding missing punctuation to recognized transcripts, if needed
|
|
75
|
+
* Real-time, streaming speech recognition
|
|
76
|
+
* Official developer API (it's currently possible to import the `echogarden` npm package as a library, but the official API has not been published yet)
|
|
77
|
+
|
|
78
|
+
### Future (maybe)
|
|
79
|
+
|
|
80
|
+
* Browser port for a subset of the API (in particular for the offline TTS models and their dependencies)
|
|
81
|
+
|
|
71
82
|
## Credits
|
|
72
83
|
|
|
73
84
|
This project consolidates, and builds upon the effort of many different individuals and companies, as well as contributing a number of original works.
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
],
|
|
105
105
|
|
|
106
106
|
"succeededBy": [
|
|
107
|
-
"itself", "us", "opportunities", "them", "his", "her", "our", "my", "its", "this", "no", "some", "another", "different", "various", "several", "many", "few", "other", "unique", "special", "great", "excellent", "nice"
|
|
107
|
+
"itself", "us", "opportunities", "them", "a", "an", "his", "her", "our", "my", "its", "this", "no", "some", "another", "different", "various", "several", "many", "few", "other", "unique", "special", "great", "excellent", "nice"
|
|
108
108
|
],
|
|
109
109
|
|
|
110
110
|
"notSucceededBy": [
|
package/docs/CLI.md
CHANGED
|
@@ -10,6 +10,10 @@ Here's a quick tour of the main operations available via the CLI.
|
|
|
10
10
|
|
|
11
11
|
Each command can accepts one or more options, in the form `--[optionName]=[value]` (The `=` is required). A detailed reference of all the available options can be found [here](Options.md).
|
|
12
12
|
|
|
13
|
+
**Keyboard shortcuts**:
|
|
14
|
+
* While the program is running, you can press `esc` to exit immediately
|
|
15
|
+
* When audio is playing, you can press `enter` to skip it
|
|
16
|
+
|
|
13
17
|
## Text to speech
|
|
14
18
|
|
|
15
19
|
**Task**: given a text file, synthesize spoken audio for it.
|
|
@@ -44,12 +48,12 @@ The CLI supports multiple output files. This would synthesize a text file, and s
|
|
|
44
48
|
echogarden speak-file text.txt result.mp3 result.wav result.srt --engine=vits --speed=1.1
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
Synthesize a web page (will try to extract its main article parts and omit the rest):
|
|
51
|
+
Synthesize a web page (it will try to extract its main article parts and omit the rest):
|
|
48
52
|
```bash
|
|
49
53
|
echogarden speak-url https://example.com/hola
|
|
50
54
|
```
|
|
51
55
|
|
|
52
|
-
Synthesize a Wikipedia article in any of its language editions:
|
|
56
|
+
Synthesize a Wikipedia article, in any of its language editions:
|
|
53
57
|
```bash
|
|
54
58
|
echogarden speak-wikipedia "Psychologie" --language=fr
|
|
55
59
|
```
|
|
@@ -198,7 +202,7 @@ Try to identify the language of a text file, and print the probabilities to the
|
|
|
198
202
|
echogarden detect-text-language story.txt
|
|
199
203
|
```
|
|
200
204
|
|
|
201
|
-
Try to identify the language of a text file, and store the probabilities in a JSON file:
|
|
205
|
+
Try to identify the language of a text file, and store the detailed probabilities in a JSON file:
|
|
202
206
|
```bash
|
|
203
207
|
echogarden detect-text-language story.txt detection-results.json
|
|
204
208
|
```
|
package/docs/Development.md
CHANGED
|
@@ -4,6 +4,16 @@ So far, this project has been the solo work of a single person (yours truly).
|
|
|
4
4
|
|
|
5
5
|
However, there are many areas where contributions can be made.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Reporting any issue or bug you encounter
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Especially if you're using the macOS platform, since I don't have access to a macOS machine.
|
|
10
|
+
|
|
11
|
+
## Reporting odd TTS pronunciations and other fail cases
|
|
12
|
+
|
|
13
|
+
Though that may be an issue with model training, which should be forwarded to the original authors
|
|
14
|
+
|
|
15
|
+
## Extending the pronunciation lexicons
|
|
16
|
+
|
|
17
|
+
Especially if you are proficient in a language other than English. In many cases, the default phonemizations produced by the eSpeak engine are incorrect
|
|
18
|
+
|
|
19
|
+
You can also add rules to help resolve the pronunciations of heteronyms (words that are written the same but can be pronounced in different ways depending on their context) based on their context.
|
package/docs/Engines.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
## Text to speech
|
|
5
5
|
|
|
6
6
|
**Offline**:
|
|
7
|
-
* [VITS](https://github.com/jaywalnut310/vits) (`vits`): a high-quality end-to-end neural speech synthesis architecture.
|
|
7
|
+
* [VITS](https://github.com/jaywalnut310/vits) (`vits`): a high-quality end-to-end neural speech synthesis architecture. Available models were trained by Michael Hansen as part of his [Piper speech synthesis system](https://github.com/rhasspy/piper). Currently there are 83 voices, in a range of languages, including English (US, UK), Spanish (ES, MX), Brazilian Portuguese, Italian, French, German, Dutch (NL, BE), Swedish, Norwegian, Danish, Finnish, Polish, Greek, Russian, Ukrainian, Catalan, Icelandic, Swahili, Kazakh, Georgian, Nepali, Vietnamese and Chinese. You can listen to audio samples of all voices and languages in [Piper's samples page](https://rhasspy.github.io/piper-samples/).
|
|
8
8
|
* [SVOX Pico](https://github.com/naggety/picotts) (`pico`): a legacy diphone-based synthesis engine. Supports English (US, UK), Spanish, Italian, French, and German.
|
|
9
9
|
* [Flite](https://github.com/festvox/flite) (`flite`): a legacy diphone-based synthesis engine. Supports English (US, Scottish), and several Indic languages: Hindi, Bengali, Marathi, Telugu, Tamil, Gujarati, Kannada and Punjabi.
|
|
10
10
|
* [eSpeak-NG](https://github.com/espeak-ng/espeak-ng/) (`espeak`): a lightweight "robot" sounding formant-based synthesizer. Supports 100+ languages. Extensively used internally for speech alignment, phonemization, and other internal tasks.
|
|
@@ -59,8 +59,8 @@ These are commercial services that require a subscription and an API key to use:
|
|
|
59
59
|
|
|
60
60
|
These engines' goal is to match (or "align") a given spoken recording with a given transcript as closely as possible. They will annotate each word in the transcript with approximate start and end timestamps:
|
|
61
61
|
|
|
62
|
-
* Dynamic Time Warping (`dtw`): transcript is first synthesized using the
|
|
63
|
-
* Dynamic Time Warping with Recognition Assist (`dtw-ra`): recognition is applied to the audio (any recognition engine can be used), then both the ground-truth transcript and the recognized transcript are synthesized using
|
|
62
|
+
* Dynamic Time Warping (`dtw`): transcript is first synthesized using the eSpeak engine, then [DTW](https://en.wikipedia.org/wiki/Dynamic_time_warping) is applied to find the best mapping between the synthesized audio and the original audio.
|
|
63
|
+
* Dynamic Time Warping with Recognition Assist (`dtw-ra`): recognition is applied to the audio (any recognition engine can be used), then both the ground-truth transcript and the recognized transcript are synthesized using eSpeak. Then, the best mapping is found between the two synthesized audio sequences, and the result is mapped back to the original audio using the timing information produced by the recognizer.
|
|
64
64
|
* Whisper-based alignment (`whisper`): transcript is tokenized and decoded along with the audio using the Whisper model, then timestamps are extracted from the internal state of the model (_note_: currently, only supports audio inputs that are 30 seconds or less).
|
|
65
65
|
|
|
66
66
|
## Speech translation
|
|
@@ -70,8 +70,8 @@ These engines' goal is to match (or "align") a given spoken recording with a giv
|
|
|
70
70
|
## Language detection
|
|
71
71
|
|
|
72
72
|
**Spoken language detection**:
|
|
73
|
-
* [Whisper](https://github.com/openai/whisper) (`whisper`): uses the language token produced by the `whisper` speech recognition model to generate a set of probabilities for the 99 languages it has been trained on.
|
|
74
73
|
* [Silero Language Classifier](https://github.com/snakers4/silero-vad/wiki/Other-Models) (`silero`): a speech language classification model by Silero.
|
|
74
|
+
* [Whisper](https://github.com/openai/whisper) (`whisper`): uses the language token produced by the `whisper` speech recognition model to generate a set of probabilities for the 99 languages it has been trained on (_note_: currently only uses the first 30 seconds of the audio).
|
|
75
75
|
|
|
76
76
|
**Text language detection**:
|
|
77
77
|
* [TinyLD](https://www.npmjs.com/package/tinyld) (`tinyld`): a simple language detection library.
|
package/docs/Options.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Configuration options reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Here is a detailed reference for the options accepted by the Echogarden API and CLI.
|
|
4
|
+
|
|
5
|
+
Related resources you may need:
|
|
6
|
+
* [A comprehensive list of all supported engines](Engines.md)
|
|
7
|
+
* [A guide on how to use the command line interface](CLI.md)
|
|
4
8
|
|
|
5
9
|
## Synthesis
|
|
6
10
|
|
package/docs/Tasklist.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# Developer's task list
|
|
2
|
+
|
|
3
|
+
## Bugs
|
|
4
|
+
|
|
5
|
+
### Audio player
|
|
6
|
+
* In rare situations, the audio player fails when encountering encoded markup (it can't find it in the text). Decide what to do when this happens
|
|
7
|
+
|
|
8
|
+
### Phoneme processing
|
|
9
|
+
* IPA -> Kirshenbaum translation is still not completely similar to what is output by eSpeak. Also, in rare situations, it outputs characters that are not accepted by eSpeak and eSpeak errors. Investigate when that happens and how to improve on this
|
|
10
|
+
|
|
11
|
+
### Segmentation
|
|
12
|
+
* eSpeak workaround for getting markers to work after sentence boundaries fails on some edge cases, especially when the input has special characters. Sequences like `**********` or `----------` fail.
|
|
13
|
+
|
|
14
|
+
### Browser extension
|
|
15
|
+
* Investigate why WebSpeech events sometimes completely stop working in the middle of an utterance for no apparent reason. Sometimes this is permanent, until the extension is restarted. Is this a browser issue?
|
|
16
|
+
* If a request is made and the server takes too much time to respond, the service worker may sleep and the request never canceled
|
|
17
|
+
|
|
18
|
+
### Browser extension / content script
|
|
19
|
+
* Highlighting sometimes does not appear when mouse is pressed over handle while speech of element starts
|
|
20
|
+
|
|
21
|
+
## Features and enhancements
|
|
22
|
+
|
|
23
|
+
### Browser extension
|
|
24
|
+
* Options UI
|
|
25
|
+
* Add supported engines and voices to WebSpeech voice list
|
|
26
|
+
* Pause and resume support
|
|
27
|
+
|
|
28
|
+
### Browser extension / content script
|
|
29
|
+
* Autoscroll should work even if the scrollbar relevant to the target element is not the viewport's scrollbar
|
|
30
|
+
* Find a way to show handles even for elements that start with a link
|
|
31
|
+
* Add detection for line breaks in `pre` blocks
|
|
32
|
+
* Some symbols, like `=`, `*`, `#` are not highlighted
|
|
33
|
+
* Support the custom tags used in YouTube comments
|
|
34
|
+
* Show handles based on `<br>` tags and possibly line breaks internal to the element
|
|
35
|
+
* Show handles based on sentence start positions
|
|
36
|
+
* UI or gesture to stop speech (other than the `esc` key)
|
|
37
|
+
* Hide handles when mouse leaves the viewport
|
|
38
|
+
* Don't show handles when mouse is over a large container element
|
|
39
|
+
* Button or keyboard shortcut to show and hide handles
|
|
40
|
+
* Show blinking placeholder when synthesis is loading for a particular text node
|
|
41
|
+
* Navigate paragraphs or sentences with keyboard shortcuts
|
|
42
|
+
* Minimum size when iterating text nodes to get handle
|
|
43
|
+
|
|
44
|
+
### Worker
|
|
45
|
+
* Optionally omit unnecessary data from the response (decoded input, segment data, etc.)
|
|
46
|
+
* Support compressed audio in response
|
|
47
|
+
* Add cancelation checks in more operations
|
|
48
|
+
* Support more operations
|
|
49
|
+
|
|
50
|
+
### CLI
|
|
51
|
+
* Don't show an error when `--help` option is given, instead suggest to type `echogarden` or `echogarden help` to get help
|
|
52
|
+
* Find a way to ensure that a user who typed `align audio.mp3 transcript.txt` and then changed to `transcribe audio.mp3 transcript.txt` won't accidently overwrite their transcript file. Simple solution, but possibly not the best solution: `align audio.mp3 --reference=transcript.txt`. Other solution: on `transcribe` and `translate-speech`, ask if output file already exist or require an `--overwrite` flag to ensure that the user intended to overwrite the existing file.
|
|
53
|
+
* Restrict input media file extensions to a set list to avoid cases where a media file would be overwritten due to user error
|
|
54
|
+
* Show a message when a new version is available
|
|
55
|
+
* Figure out which terminal outputs should go to stdout, or if that's a good idea at all
|
|
56
|
+
* Option to set audio output codec options
|
|
57
|
+
* Option to set audio output device
|
|
58
|
+
* Print available synthesis voices when no voice matches (or suggest near matches)
|
|
59
|
+
* `transcribe` can also accept `http://` and `https://` URLs
|
|
60
|
+
* Use a file type detector like `file-type` that uses magic numbers to detect the type of a binary file regardless of its extension. This would help giving better error messages when the given file type is wrong.
|
|
61
|
+
* Consider adding the text offset to each segment, sentence and word in the resulting timeline with respect to the original file (even if it is, say, HTML or captions file)
|
|
62
|
+
* Add phone playback support
|
|
63
|
+
* More fine-grained intermediate progress report for operations
|
|
64
|
+
* Suggest possible correction on the error of not using `=`, e.g. `speed 0.9` instead of `speed=0.9`
|
|
65
|
+
* Multiple configuration files in `--config=..` taking precedence by order
|
|
66
|
+
* Support comments in JSON configuration file
|
|
67
|
+
* Generate JSON configuration file schema
|
|
68
|
+
* Make enum options case-insensitive if possible
|
|
69
|
+
* Mode to print IPA words when speaking
|
|
70
|
+
* Support list-typed properties configuration files (already supported in JSON)
|
|
71
|
+
|
|
72
|
+
### CLI / `speak-wikipedia`
|
|
73
|
+
* Correctly detect language when a Wikipedia URL is passed instead of an article name
|
|
74
|
+
* Add option to set language edition separately from language, since they use different language codes in some cases
|
|
75
|
+
|
|
76
|
+
### CLI / `speak-url`
|
|
77
|
+
* Use the Wikipedia reader when the URL is detected to be from `wikipedia.org`
|
|
78
|
+
|
|
79
|
+
### CLI / `list-packages`
|
|
80
|
+
* Support filters
|
|
81
|
+
|
|
82
|
+
### CLI / Configuration file
|
|
83
|
+
* Support arrays
|
|
84
|
+
|
|
85
|
+
### CLI / New commands
|
|
86
|
+
* `help`: Show help for a particular command, like `help transcribe`
|
|
87
|
+
* `list-engines`: List available engines for a particular command, like `list-engines speak`
|
|
88
|
+
* `play-with-captions`: Preview captions in terminal
|
|
89
|
+
* `play-with-timeline`: Preview timeline in terminal
|
|
90
|
+
* `captions-to-text`, `captions-to-timeline`, `srt-to-vtt`, `vtt-to-srt`
|
|
91
|
+
* `crop-to-timeline`, `split-by-timeline`
|
|
92
|
+
* `text-to-ipa`, `arpabet-to-ipa`, `ipa-to-arpabet`
|
|
93
|
+
* `phonemize-text`
|
|
94
|
+
* `normalize-text`
|
|
95
|
+
* `pos-tag-text`
|
|
96
|
+
* `remove-nonspeech`
|
|
97
|
+
* `speak-youtube`: To speak the transcript of a YouTube video
|
|
98
|
+
|
|
99
|
+
### API
|
|
100
|
+
* Option to control logging verbosity
|
|
101
|
+
* Add support to accept caption options in API and CLI
|
|
102
|
+
* Support full language names as inputs
|
|
103
|
+
* Retry on error when connecting to cloud providers, including WebSocket disconnection with `microsoft-edge` (already supported by `gaxios`, not sure about `ws` - decide on default setting)
|
|
104
|
+
* Validate timelines to ensure timestamps are always increasing, no -1 timestamps or timestamps over the time of the audio, no sentences without words, etc. and correct if needed
|
|
105
|
+
* Time/pitch shifting for recognition and alignment results
|
|
106
|
+
* Add support for phrases in timelines
|
|
107
|
+
* Accept voice list caching options in `SynthesisOptions`
|
|
108
|
+
|
|
109
|
+
### Language detection
|
|
110
|
+
* Deploy and add the new language detection model
|
|
111
|
+
* When using Whisper for language detection of speech, apply it to the entire audio, not just the first 30 seconds
|
|
112
|
+
|
|
113
|
+
### Segmentation
|
|
114
|
+
* Option to split segment on single line break as well as double line break (when splitting on double line breaks, there might be cases where a single line break should be seen as a sentence boundary - a line in song lyrics). Maybe a better approach is to optionally preprocess the text and merge subsequent lines than are intended to be a part of the same paragraph. In this way, paragraph breaks would always be single line breaks, and there's no need to carry settings for this detail within the program.
|
|
115
|
+
* Split long words
|
|
116
|
+
* See if it's possible to reliably use eSpeak as a segmentation engine
|
|
117
|
+
* Path to `kuromoji` dictionaries can be found more reliably than current
|
|
118
|
+
|
|
119
|
+
### Captions
|
|
120
|
+
* If a subtitle is too short and at the end of the audio, try to extend it back if possible (for example, if the previous subtitle is already extended, take back from it)
|
|
121
|
+
* Split long words if needed
|
|
122
|
+
* Decide how many punctuation characters to allow before breaking to a new line (currently it's infinite)
|
|
123
|
+
* Add more clause separators, for even more special cases
|
|
124
|
+
* Add option to output word or phoneme-level caption files (investigate how it's done on YouTube auto-captions)
|
|
125
|
+
* Parse VTT's language
|
|
126
|
+
* Option to generate captions that have word-level timings
|
|
127
|
+
|
|
128
|
+
### Synthesis
|
|
129
|
+
* Find places to add commas (",") to improve speech fluency. VITS voices don't normally add phrasing breaks if there is no punctuation
|
|
130
|
+
* An isolated dash " - " can be converted to a " , " to ensure there's a break in the speech.
|
|
131
|
+
* Ensure abbreviations like "Ph.d" or names like are segmented and read correctly (why doesn't `cldr` treat it as a word? Maybe it's not getting the right parameters, or it's not included in the list?) and "C#"
|
|
132
|
+
* Use preprocessed eSpeak in places other than VITS
|
|
133
|
+
* Way to manually reset voice list cache
|
|
134
|
+
* When synthesized text isn't pre-split to sentences, apply sentence splits by using the existing method to convert the output of word timelines to sentence/segment timelines
|
|
135
|
+
* Log full language of selected voice (it may have a different dialect than expected)
|
|
136
|
+
* Add partial SSML support for all engines. In particular, allow changing language or voice using the `<voice>` and `<lang>` tags, `<say-as>` and `<phoneme>` where possible.
|
|
137
|
+
* Some `sapi` voices and `msspeech` languages output phones that are converted to Microsoft alphabet, not IPA symbols. Try to see if these can be translated to IPA
|
|
138
|
+
* Decide whether asterisk `*` should be spoken when using `speak-url` or `speak-wikipedia`
|
|
139
|
+
* Decide what to do with `«` and `»` punctuation characters (guillemets) when parsing and playing
|
|
140
|
+
* Use VAD on the synthesized audio file to get more accurate sentence or word segmentation
|
|
141
|
+
* Try to remove reliance on `()` after `.` character hack in `EspeakTTS.synthesizeFragments`.
|
|
142
|
+
* eSpeak IPA output puts stress marks on vowels, not syllables - which is the standard for IPA. Consider how to make a conversion to and from these two approaches (possibly detect it automatically).
|
|
143
|
+
* Investigate if `espeak` can be made to correctly support phonemizing and pronouncing the dot character like in `object.key`
|
|
144
|
+
* Speaker-specific voice option
|
|
145
|
+
* Decide if `msspeech` engine should be selected if available. This would require attempting to load a matching voice, and falling back if it is not installed
|
|
146
|
+
* Option to disable alignment
|
|
147
|
+
|
|
148
|
+
### Synthesis / preprocessing
|
|
149
|
+
* Extend the heteronyms JSON document with more words
|
|
150
|
+
* Full date normalization (e.g. `21 August 2023`)
|
|
151
|
+
* Support custom lexicons. For example, a lexicon for general pronunciation corrections (for example `ee-lon` instead of `eh-lon`)
|
|
152
|
+
* Add support for capitalized only rules, and possibly also all uppercase / all lowercase rules.
|
|
153
|
+
* Support normalizing to graphemes, not only phonemes
|
|
154
|
+
* Is it possible to pre-phonemize common words like "the" or is it a bad idea / not necessary?
|
|
155
|
+
* Add support for user-defined lexicons for VITS synthesis (or any other one that supports preprocessing)
|
|
156
|
+
* Add support for text normalization preprocessing for all engines that can benefit from it (possibly including cloud engines).
|
|
157
|
+
* Add SAPI pronunciation to lexicons (the information is already there for `en_US` and `en_GB`)
|
|
158
|
+
* Try to use entity recognition to detect years, dates, currencies etc., which would disambiguate cases where it is not clear, like "in 1993" in "She was born in 1993" and "It searched in 1993 websites"
|
|
159
|
+
* Option to add POS tags to timeline, if available
|
|
160
|
+
* Cache lexicons to avoid parsing the JSON each time it is loaded (this may not be needed for now since the existing one is relatively small)
|
|
161
|
+
|
|
162
|
+
### VITS
|
|
163
|
+
* Allow to limit how many models are cached in memory
|
|
164
|
+
* Custom model paths (decide how to implement)
|
|
165
|
+
* Pull voice list from JSON file based on URL? Is that a good idea?
|
|
166
|
+
|
|
167
|
+
### Recognition
|
|
168
|
+
* Add confidence to each recognized word, if available
|
|
169
|
+
* Show alternatives when playing in the CLI. Clear current line and rewrite already printed text for alternatives during the speech recognition process
|
|
170
|
+
* Look for good split points using VAD before performing recognition
|
|
171
|
+
* Option to split recognized audio to segments or sentences, as is done with synthesized audio
|
|
172
|
+
|
|
173
|
+
### Whisper
|
|
174
|
+
* When using `dtw-ra` alignment, pass the transcript as a prompt. Remove some of the initial transcript based on what has been detected (try to find the best matching initial segment between the transcript and recognized text, and remove it at each recognition window).
|
|
175
|
+
* During language detection, if file is more than 30s, run the detection over all the segments and average the resulting probability distributions, consider how to handle very short segments
|
|
176
|
+
* Timestamps extracted from cross-attention are still not as accurate as what the official Python implementation gets. Try to see if you can make them better.
|
|
177
|
+
* Cache last model
|
|
178
|
+
* Integrate speech language detection into the recognition itself, so it is done efficiently when the language is not known
|
|
179
|
+
* Bring back option to use eSpeak DTW based alignment on segments, as an alternative approach
|
|
180
|
+
* The segment output can be use to split to segment files, otherwise it is possible to try to guess using the pause lengths or voice activity detection
|
|
181
|
+
* Way to specify model size, such that the English-only/multilingual would be auto selection for sizes other than `tiny`?
|
|
182
|
+
|
|
183
|
+
### Postprocessing
|
|
184
|
+
* When `normalize` is set to false, should obvious clipping still be prevented?
|
|
185
|
+
|
|
186
|
+
## Maintenance and cleanup
|
|
187
|
+
|
|
188
|
+
* Find a way to reset voice list cache on update
|
|
189
|
+
* CLI code has a lot of repetition. See how it can be refactored
|
|
190
|
+
* See if the installation of `winax` can be automated and only initiate if it is in a Windows environment
|
|
191
|
+
* Ensure that all modules have no internal state other than caching
|
|
192
|
+
* Start thinking about some modules being available in the browser. Which node core APIs the use? Which of them can be polyfilled, an which cannot?
|
|
193
|
+
* Change all the Emscripten WASM modules to use the `EXPORT_ES6=1` flag to all of them and rebuild them. Support for node.js was only added in September 2022 (https://github.com/emscripten-core/emscripten/pull/17915), so maybe wait a little bit until it is stable.
|
|
194
|
+
* Remove built-in voices from `flite` to reduce size?
|
|
195
|
+
|
|
196
|
+
## External bugs
|
|
197
|
+
|
|
198
|
+
* `espeak-ng`: 'Oh dear!”' is read as "oh dear exclamation mark", because of the special quote following the exclamation mark
|
|
199
|
+
* `espeak-ng`: [Marker right after sentence end is not reported as an event](https://github.com/espeak-ng/espeak-ng/issues/920)
|
|
200
|
+
* `espeak-ng`: On Japanese text, it says "Chinese character" or "Japanese character" for characters it doesn't know
|
|
201
|
+
* `wtf_wikipedia` Sometimes fails on `getResult.js` without throwing a humanly readable error
|
|
202
|
+
* `wtf_wikipedia` Sometimes captures markup like `.svg` etc.
|
|
203
|
+
* `msspeech`: Initialization fails on Chinese and Japanese voices (but not Korean)
|
|
204
|
+
* `compromise`: Slow initialization time. Currently it takes more than a second
|
|
205
|
+
* Chromium doesn't fire timer events when cursor is positioned over scrollbar or body margins
|
|
206
|
+
|
|
207
|
+
## Things to test
|
|
208
|
+
|
|
209
|
+
* Test that SSML works where it should
|
|
210
|
+
* Test synthesis, recognition and alignment with empty input. Do they still work?
|
|
211
|
+
|
|
212
|
+
## Future features and enhancements
|
|
213
|
+
|
|
214
|
+
### CLI
|
|
215
|
+
* Synthesize given subtitle file and try to preserve the existing timing of cues, or even align to existing speech
|
|
216
|
+
* Auto-generate options file, with comments, based on default options of the API
|
|
217
|
+
* Have the CLI launch a background worker (in a thread) to enable better parallelism
|
|
218
|
+
* Play back result audio while synthesis or recognition is still processing on the background (may require `worker_threads`)
|
|
219
|
+
* Navigate up down backward forward on file with timeline
|
|
220
|
+
* Auto-import project Gutenberg texts (by URL or from a file)
|
|
221
|
+
* `stdin` input support
|
|
222
|
+
* `stdout` output support
|
|
223
|
+
* Markdown file as text input?
|
|
224
|
+
|
|
225
|
+
### API
|
|
226
|
+
* Auto-install npm modules when needed using something like `npm-programmatic`
|
|
227
|
+
|
|
228
|
+
### Text enhancement
|
|
229
|
+
* Add capitalization and punctuation when to recognition outputs (Silero has a model for it for `en`, `de`, `ru`, `es`, but in `.pt` format only)
|
|
230
|
+
|
|
231
|
+
### Synthesis / preprocessing
|
|
232
|
+
* Extend preprocessing to other language versions of `compromise`. There are versions for French, German, Italian and Spanish
|
|
233
|
+
|
|
234
|
+
### Recognition
|
|
235
|
+
* Low latency recognition mode. Make the partial transcription available as fast as possible
|
|
236
|
+
* Live input / microphone recognition
|
|
237
|
+
* Live vosk alternatives events
|
|
238
|
+
* Implement beam search for Whisper decoder
|
|
239
|
+
* Implement beam search for Silero decoder
|
|
240
|
+
|
|
241
|
+
### Web
|
|
242
|
+
* Web based frontend UI to the server
|
|
243
|
+
* Adapt some WASM modules to also run on the web
|
|
244
|
+
* Investigate running in WebContainer
|
|
245
|
+
|
|
246
|
+
### Alignment
|
|
247
|
+
* Align audio file to audio file
|
|
248
|
+
* Alignment with speech translation assistance, which would enable multilingual subtitle replacement for translated captions
|
|
249
|
+
* Make `dtw` mode work with more speech synthesizers to produce its reference
|
|
250
|
+
|
|
251
|
+
## Documentation
|
|
252
|
+
|
|
253
|
+
### CLI
|
|
254
|
+
* Document the `serve` command
|
|
255
|
+
|
|
256
|
+
## Possible new engines or platforms
|
|
257
|
+
|
|
258
|
+
* OpenAI Whisper cloud service (`large-v2` model is available, at a price).
|
|
259
|
+
* [Assembly AI cloud service](https://www.assemblyai.com/)
|
|
260
|
+
* [Deepgram cloud service](https://deepgram.com/)
|
|
261
|
+
* `whisper.cpp` CLI and WASM support
|
|
262
|
+
* Coqui STT server connection
|
|
263
|
+
* See what can be done on supporting WinRT speech: in particular `windows.media.speechsynthesis` and `windows.media.speechrecognition` support, possibly using NodeRT or some other method.
|
|
264
|
+
* Figure out how to support `julius` speech recognition via WASM.
|
|
265
|
+
* Any way to support RHVoice?
|
|
266
|
+
* Silero text enhancement engine can be ported to ONNX
|
|
267
|
+
* Investigate Raspberry Pi support. In particular, see if `onnxruntime-node` can be built for this environment
|
|
268
|
+
* Reimplement KNN model in ONNX for better performance
|
|
269
|
+
|
|
270
|
+
## Maybe?
|
|
271
|
+
|
|
272
|
+
* PDF support
|
|
273
|
+
* Using a machine translation model to provide speech translation to languages other than English?
|
|
274
|
+
* Is it possible to get sentence boundaries without punctuation using NLP techniques like part of speech tagging?
|
|
275
|
+
|
|
276
|
+
## May or may not be good ideas
|
|
277
|
+
|
|
278
|
+
* Bring back interleaved playback
|
|
279
|
+
* Bring back debugging file output
|
|
280
|
+
|
|
281
|
+
## Other ideas
|
|
282
|
+
|
|
283
|
+
* HTML generator, that includes text and audio, with playback and word highlighting
|
|
284
|
+
* Video generator
|
|
285
|
+
* Desktop app that uses the tool to transcribe the PC audio output
|
|
286
|
+
* Special method to use time stretching to project between different utterances of the same text
|
|
287
|
+
* Is it possible to combine the Silero speech recognizer and a language model and try to perform Viterbi decoding to find alignments?
|
|
288
|
+
* Voice replacement
|
|
289
|
+
* Predict timing for individual letters (graphemes) based on phoneme timestamps
|
package/docs/Technical.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
* Echogarden is written in TypeScript and targets the Node.js platform.
|
|
4
4
|
* It uses ESM modules and latest ECMAScript and TypeScript features.
|
|
5
|
-
* It does not depend on essential binary executables. Instead, all of its engines either use pure JavaScript, WebAssembly, WASI, or the ONNX runtime
|
|
5
|
+
* It does not depend on essential binary executables. Instead, all of its engines either use pure JavaScript, WebAssembly, WASI, or the ONNX runtime, with some exceptions: the CLI does invoke a few binary executables, loaded from expansion packages, for the `SoX` and `ffmpeg` tools. Using expansion packages simplifies the installation and ensures non-buggy version are used. Since SoX `v14.4.2` is broken on Windows, it bundles `v14.4.1`.
|
|
6
6
|
* It does not depend on essential native node.js modules requiring compilation with `node-gyp`. This greatly simplifies the installation experience for end-users (the ONNX runtime bundles precompiled NAPI modules for all supported platforms - it doesn't require any compilation during its installation).
|
|
7
7
|
|
|
8
8
|
## Package system
|
|
@@ -34,7 +34,7 @@ Currently, the biggest contributors to the size are:
|
|
|
34
34
|
|
|
35
35
|
`onnxruntime-node` is big because it bundles pre-compiled binaries for multiple platforms. `kuromoji` is large because of its dictionary files and some unessential test code it bundles. The other three packages include large WASM binaries.
|
|
36
36
|
|
|
37
|
-
So, yes, in the future it may be possible to reduce the core installed size by dynamically installing some of these dependencies, or using modified, "slimmed-down"
|
|
37
|
+
So, yes, in the future it may be possible to reduce the core installed size by dynamically installing some of these dependencies, or using modified, "slimmed-down" versions of some packages.
|
|
38
38
|
|
|
39
39
|
## Since the code is almost all JavaScript and WASM, why can't it just run in a web browser?
|
|
40
40
|
|
package/package.json
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echogarden",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "A fully open-source speech system designed with end-users in mind.",
|
|
5
5
|
"author": "Rotem Dan",
|
|
6
6
|
"license": "GPL-3.0-only",
|
|
7
7
|
"keywords": [
|
|
8
|
-
"tts",
|
|
9
8
|
"text-to-speech",
|
|
10
|
-
"stt",
|
|
11
|
-
"speech-to-text",
|
|
12
|
-
"speech processing",
|
|
13
9
|
"speech synthesis",
|
|
10
|
+
"speech-to-text",
|
|
14
11
|
"speech recognition",
|
|
12
|
+
"speech processing",
|
|
15
13
|
"speech alignment",
|
|
16
14
|
"forced alignment",
|
|
17
15
|
"speech translation",
|
|
18
|
-
"language
|
|
16
|
+
"language identification",
|
|
19
17
|
"language detection"
|
|
20
18
|
],
|
|
21
19
|
"repository": {
|
package/docs/Roadmap.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Roadmap
|
|
2
|
-
|
|
3
|
-
- [x] Publish a working command line application
|
|
4
|
-
- [x] Smooth out any significant bugs
|
|
5
|
-
- [x] Ensure platform support
|
|
6
|
-
- [x] Add missing features, options or commands to the CLI
|
|
7
|
-
- [x] Design a message-based worker API
|
|
8
|
-
- [x] Implement the worker API
|
|
9
|
-
- [x] Implement a WebSocket server that implements the worker API
|
|
10
|
-
- [ ] Publish the worker API. Add any extra methods or options needed for that to happen
|
|
11
|
-
- [ ] Develop a browser extension, talking the WebSocket server
|
|
12
|
-
- [ ] Develop a web-based client app, talking to, and hosted on the server
|
|
13
|
-
- [ ] Modify the CLI app to internally use the background worker for some tasks
|
|
14
|
-
- [ ] Further improve the client app
|
|
15
|
-
- [ ] Port some of the offline speech synthesis API to the browser (in particular the `vits`, `pico`, `flite`, `eSpeak` engines)
|