@jambonz/speech-utils 1.0.3 → 1.0.6

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/test/nuance.js DELETED
@@ -1,81 +0,0 @@
1
- const test = require('tape').test ;
2
- const config = require('config');
3
- const opts = config.get('redis');
4
- const fs = require('fs');
5
- const logger = require('pino')({level: 'error'});
6
- process.on('unhandledRejection', (reason, p) => {
7
- console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
8
- });
9
-
10
- const stats = {
11
- increment: () => {},
12
- histogram: () => {}
13
- };
14
-
15
- test('Nuance hosted tests', async(t) => {
16
- const fn = require('..');
17
- const {client, getTtsVoices} = fn(opts, logger);
18
-
19
- if (!process.env.NUANCE_CLIENT_ID || !process.env.NUANCE_SECRET ) {
20
- t.pass('skipping Nuance hosted test since no Nuance client_id and secret provided');
21
- t.end();
22
- client.quit();
23
- return;
24
- }
25
- try {
26
- const opts = {
27
- vendor: 'nuance',
28
- credentials: {
29
- client_id: process.env.NUANCE_CLIENT_ID,
30
- secret: process.env.NUANCE_SECRET
31
- }
32
- };
33
- let voices = await getTtsVoices(opts);
34
- t.ok(voices.length > 0 && voices[0].language,
35
- `GetVoices: successfully retrieved ${voices.length} voices from Nuance`);
36
-
37
- await client.flushall();
38
-
39
- t.end();
40
-
41
- }
42
- catch (err) {
43
- console.error(err);
44
- t.end(err);
45
- }
46
- client.quit();
47
- });
48
-
49
- test('Nuance on-prem tests', async(t) => {
50
- const fn = require('..');
51
- const {client, getTtsVoices} = fn(opts, logger);
52
-
53
- if (!process.env.NUANCE_TTS_URI ) {
54
- t.pass('skipping Nuance on-prem test since no Nuance uri provided');
55
- t.end();
56
- client.quit();
57
- return;
58
- }
59
- try {
60
- const opts = {
61
- vendor: 'nuance',
62
- credentials: {
63
- nuance_tts_uri: process.env.NUANCE_TTS_URI
64
- }
65
- };
66
- let voices = await getTtsVoices(opts);
67
- t.ok(voices.length > 0 && voices[0].language,
68
- `GetVoices: successfully retrieved ${voices.length} voices from Nuance`);
69
-
70
- await client.flushall();
71
-
72
- t.end();
73
-
74
- }
75
- catch (err) {
76
- console.error(err);
77
- t.end(err);
78
- }
79
- client.quit();
80
- });
81
-