piper-phonemize 1.5.3 → 1.5.5
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 +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/piper-phonemize-wasm-nodejs.wasm +0 -0
- package/piper-phonemize.node.js +3 -3
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Phonemize text and return raw phoneme code points.
|
|
|
37
37
|
|
|
38
38
|
- `text` (string): Text to phonemize
|
|
39
39
|
- `voice` (string, optional): espeak-ng voice (e.g., 'en-us', 'de', 'fr'). Default: 'en-us'
|
|
40
|
-
- Returns: Array of sentences, each containing an array of
|
|
40
|
+
- Returns: Array of sentences, each containing an array of int32 code points, or null on failure
|
|
41
41
|
|
|
42
42
|
### `phonemizeToString(text, voice)`
|
|
43
43
|
|
package/index.js
CHANGED
|
@@ -68,7 +68,7 @@ function getVersion() {
|
|
|
68
68
|
*
|
|
69
69
|
* @param {string} text - Text to phonemize
|
|
70
70
|
* @param {string} [voice='en-us'] - espeak-ng voice (e.g., 'en-us', 'de', 'fr')
|
|
71
|
-
* @returns {Array<Array<number>>|null} Array of sentences, each containing phoneme code points (
|
|
71
|
+
* @returns {Array<Array<number>>|null} Array of sentences, each containing phoneme code points (int32), or null on failure
|
|
72
72
|
*/
|
|
73
73
|
function phonemize(text, voice) {
|
|
74
74
|
ensureInitialized();
|
package/package.json
CHANGED
|
Binary file
|
package/piper-phonemize.node.js
CHANGED
|
@@ -72,7 +72,7 @@ function getVersionStr() {
|
|
|
72
72
|
*
|
|
73
73
|
* @param {string} text - Text to phonemize
|
|
74
74
|
* @param {string} [voice='en-us'] - espeak-ng voice (e.g., 'en-us', 'de', 'fr')
|
|
75
|
-
* @returns {Array<Array<number>>|null} Array of sentences, each containing phoneme code points (
|
|
75
|
+
* @returns {Array<Array<number>>|null} Array of sentences, each containing phoneme code points (int32), or null on failure
|
|
76
76
|
*/
|
|
77
77
|
function phonemize(text, voice) {
|
|
78
78
|
if (!Module) {
|
|
@@ -117,10 +117,10 @@ function phonemize(text, voice) {
|
|
|
117
117
|
continue;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
// Read
|
|
120
|
+
// Read int32 array from WASM heap
|
|
121
121
|
const phonemes = [];
|
|
122
122
|
for (let j = 0; j < numPhonemes; j++) {
|
|
123
|
-
phonemes.push(Module.
|
|
123
|
+
phonemes.push(Module.HEAP32[(phonemesPtr >> 2) + j]);
|
|
124
124
|
}
|
|
125
125
|
sentences.push(phonemes);
|
|
126
126
|
}
|