-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
76 lines (74 loc) · 3.51 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<script type="text/x-red" data-template-name="micro-to-watson-speech-to-text-stream">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-username"><i class="icon-tag"></i> Username</label>
<input type="text" id="node-input-username">
</div>
<div class="form-row">
<label for="node-input-password"><i class="fa fa-key"></i> Password</label>
<input type="password" id="node-input-password">
</div>
<div class="form-row">
<label for="node-input-treshold"><i class="fa fa-audio-o"></i> Threshold (0-1)</label>
<input type="number" id="node-input-treshold">
</div>
<div class="form-row">
<label for="node-input-silence"><i class="fa fa-microphone-slash"></i> Silence timeout (seconds)</label>
<input type="number" id="node-input-silence">
</div>
<div class="form-row">
<label for="node-input-device"><i class="fa fa-microphone"></i> Input Device</label>
<input type="text" id="node-input-device">
</div>
<div class="form-row">
<label for="node-input-model"><i class="fa fa-language"></i> Language</label>
<input type="text" id="node-input-model">
</div>
</script>
<script type="text/x-red" data-help-name="micro-to-watson-speech-to-text-stream">
<p>This node understands natural language to generate a textual representation of the spoken words. This is based on the Watson Speech to Text service. The main difference to the IBM provided node is that the audio is streamed to the Watson Speech to Text service.</p>
<p>You can choose different voices for a range of languages:</b>.</p>
<p>For audio input the default mic from the device is used. At the moment this is not configurable.</p>
<p>You can pass in <code>start</code> and <code>stop</code> commands to enable or disable the microphone. Pass the values in the <code>msg.payload</code>.</p>
<p>The returned text transcription will be returned as a string in <code>msg.payload</code>.</p>
<p>For more information about the Speech To Text service, read the <a href="https://www.ibm.com/watson/services/speech-to-text/">documentation</a>.</p>
</script>
<script type="text/javascript">
(function() {
RED.nodes.registerType('micro-to-watson-speech-to-text-stream', {
category: 'IBM Watson',
defaults: {
name: {value: ""},
silence: {value: 3},
treshold: {value: 0.1},
lang: {value: ""},
langhidden: {value: ""},
langcustom: {value: ''},
langcustomhidden: {value: ''},
voice: {value: ""},
voicehidden: {value: ""},
format: {value: "audio/wav"},
device: {value: "plughw:1,0"},
model: {value: "en-US_BroadbandModel"}
},
credentials: {
username: {type:"text"},
password: {type:"password"} // Taken out because, was not being restored on dialog open.
},
color: "rgb(140, 198, 63)",
inputs:1,
outputs:1,
icon: "icon.png",
paletteLabel: "micro speech to text stream",
label: function() {
return this.name || "micro text to speech stream";
},
labelStyle: function() {
return this.name ? "node_label_italic" : "";
}
});
})();
</script>