@jambonz/speech-utils 0.0.25 → 0.0.26
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/.github/workflows/ci.yml +5 -1
- package/index.js +4 -25
- package/package.json +2 -2
package/.github/workflows/ci.yml
CHANGED
|
@@ -24,4 +24,8 @@ jobs:
|
|
|
24
24
|
IBM_TTS_API_KEY: ${{ secrets.IBM_TTS_API_KEY }}
|
|
25
25
|
IBM_TTS_REGION: ${{ secrets.IBM_TTS_REGION }}
|
|
26
26
|
MICROSOFT_API_KEY: ${{ secrets.MICROSOFT_API_KEY }}
|
|
27
|
-
MICROSOFT_REGION: ${{ secrets.MICROSOFT_REGION }}
|
|
27
|
+
MICROSOFT_REGION: ${{ secrets.MICROSOFT_REGION }}
|
|
28
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
29
|
+
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
|
|
30
|
+
ELEVENLABS_VOICE_ID: ${{ secrets.ELEVENLABS_VOICE_ID }}
|
|
31
|
+
ELEVENLABS_MODEL_ID: ${{ secrets.ELEVENLABS_MODEL_ID }}
|
package/index.js
CHANGED
|
@@ -1,34 +1,13 @@
|
|
|
1
1
|
const {noopLogger} = require('./lib/utils');
|
|
2
|
-
const Redis = require('ioredis');
|
|
3
2
|
|
|
4
3
|
module.exports = (opts, logger) => {
|
|
5
4
|
logger = logger || noopLogger;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
for (const o of opts) {
|
|
11
|
-
o.username = process.env.JAMBONES_REDIS_USERNAME;
|
|
12
|
-
o.password = process.env.JAMBONES_REDIS_PASSWORD;
|
|
13
|
-
}
|
|
14
|
-
} else {
|
|
15
|
-
connectionOpts.username = process.env.JAMBONES_REDIS_USERNAME;
|
|
16
|
-
connectionOpts.password = process.env.JAMBONES_REDIS_PASSWORD;
|
|
17
|
-
}
|
|
5
|
+
let client = opts.redis_client;
|
|
6
|
+
if (!client) {
|
|
7
|
+
const {client: redisClient} = require('@jambonz/realtimedb-helpers')(opts, logger);
|
|
8
|
+
client = redisClient;
|
|
18
9
|
}
|
|
19
10
|
|
|
20
|
-
const client = new Redis(connectionOpts);
|
|
21
|
-
['ready', 'connect', 'reconnecting', 'error', 'end', 'warning']
|
|
22
|
-
.forEach((event) => {
|
|
23
|
-
client.on(event, (...args) => {
|
|
24
|
-
if ('error' === event) {
|
|
25
|
-
if (process.env.NODE_ENV === 'test' && args[0]?.code === 'ECONNREFUSED') return;
|
|
26
|
-
logger.error({...args}, '@jambonz/realtimedb-helpers - redis error');
|
|
27
|
-
}
|
|
28
|
-
else logger.debug({args}, `redis event ${event}`);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
11
|
return {
|
|
33
12
|
client,
|
|
34
13
|
getTtsSize: require('./lib/get-tts-size').bind(null, client, logger),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jambonz/speech-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"description": "TTS-related speech utilities for jambonz",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Dave Horton",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"@aws-sdk/client-polly": "^3.359.0",
|
|
28
28
|
"@google-cloud/text-to-speech": "^4.2.1",
|
|
29
29
|
"@grpc/grpc-js": "^1.8.13",
|
|
30
|
+
"@jambonz/realtimedb-helpers": "^0.8.7",
|
|
30
31
|
"bent": "^7.3.12",
|
|
31
32
|
"debug": "^4.3.4",
|
|
32
33
|
"form-urlencoded": "^6.1.0",
|
|
33
34
|
"google-protobuf": "^3.21.2",
|
|
34
35
|
"ibm-watson": "^8.0.0",
|
|
35
|
-
"ioredis": "^5.3.2",
|
|
36
36
|
"microsoft-cognitiveservices-speech-sdk": "^1.31.0",
|
|
37
37
|
"openai": "^4.16.2",
|
|
38
38
|
"undici": "^5.21.0"
|