This repository was archived by the owner on Sep 23, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +1199
-32
lines changed Expand file tree Collapse file tree 7 files changed +1199
-32
lines changed Original file line number Diff line number Diff line change 2
2
All notable changes to this project will be documented in this file.
3
3
This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
4
4
5
+ ## 1.0.2 - 2017-04-17
6
+ * Update docs.
7
+ * Remove console.log where it wasn't needed.
8
+ * Update example slightly.
9
+ * Removed all hope of shipping an API key.
10
+
5
11
## 1.0.1 - 2017-04-17
6
12
* Change ` .listen() ` to ` .start() ` .
7
13
Original file line number Diff line number Diff line change @@ -28,6 +28,17 @@ s2t.start()
28
28
s2t .stop ()
29
29
```
30
30
31
+ To run the example:
32
+
33
+ ```
34
+ npm install
35
+ npm start
36
+ ```
37
+
38
+ You are required to set up your own service account since the speech recognition API requires an account with billing. See:
39
+
40
+ https://cloud.google.com/speech/docs/common/auth
41
+
31
42
# API
32
43
33
44
#### ` var s2t = new GetUserMediaToSpeech(options) `
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ function store (state, bus) {
21
21
state . msgs = [ ]
22
22
state . listening = false
23
23
24
- s2t . on ( 'error' , log )
24
+ s2t . on ( 'error' , logError )
25
+ function logError ( error ) {
26
+ state . msgs . push ( error . message )
27
+ }
25
28
s2t . on ( 'status' , log )
26
29
function log ( data ) {
27
30
state . msgs . push ( data )
Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ GetUserMediaToText.prototype.start = function () {
86
86
this . emit ( 'status' , 'Started listening' )
87
87
this . pipeline = pump ( this . audioStream , this . sinkStream , function ( err ) {
88
88
if ( err ) self . emit ( 'error' , err )
89
- console . log ( 'this called' )
90
89
self . clearPipeline ( )
91
90
} )
92
91
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " getusermedia-to-text" ,
3
- "version" : " 1.0.1 " ,
3
+ "version" : " 1.0.2 " ,
4
4
"description" : " getUserMedia to Text via Google's Speech to Text API" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
- "test" : " node test.js" ,
8
- "prepublish" : " electron-rebuild" ,
9
- "start" : " electron example/main.js"
7
+ "test" : " run-s test:*" ,
8
+ "test:deps" : " dependency-check ./package.json" ,
9
+ "test:lint" : " standard | snazzy" ,
10
+ "test:tape" : " tape test.js | tap-format-spec" ,
11
+ "start" : " electron-rebuild && electron example/main.js"
10
12
},
11
13
"repository" : {
12
14
"type" : " git" ,
34
36
"pumpify" : " ^1.3.5"
35
37
},
36
38
"devDependencies" : {
39
+ "@tap-format/spec" : " ^0.2.0" ,
37
40
"choo" : " ^5.1.5" ,
38
41
"choo-log" : " ^6.1.1" ,
42
+ "dependency-check" : " ^2.8.0" ,
39
43
"electron" : " ~1.6.2" ,
40
- "electron-rebuild" : " ^1.5.7"
44
+ "electron-rebuild" : " ^1.5.7" ,
45
+ "global" : " ^4.3.1" ,
46
+ "npm-run-all" : " ^4.0.2" ,
47
+ "snazzy" : " ^7.0.0" ,
48
+ "standard" : " ^10.0.2" ,
49
+ "tape" : " ^4.6.3"
41
50
}
42
51
}
Original file line number Diff line number Diff line change
1
+ /* eslint-disable */
2
+ window = require ( 'global/window' )
3
+ /* eslint-enable */
4
+ var test = require ( 'tape' )
5
+ var GetUserMediaToText = require ( './index' )
6
+
7
+ test ( 'module exports a function' , function ( t ) {
8
+ t . equal ( typeof GetUserMediaToText , 'function' )
9
+ t . end ( )
10
+ } )
You can’t perform that action at this time.
0 commit comments