File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ importScripts('./shared/ring-buffer.min.js');
55importScripts ( './picovoice/porcupine-wasm-interface.js' ) ;
66var PorcupineKeywords = {
77 v14 : { } ,
8+ v15 : { } ,
9+ v16 : { } ,
810 v19 : { }
911}
1012
@@ -128,7 +130,12 @@ function constructWorker(options) {
128130
129131 porcupineVersion = options . setup . version || options . setup . porcupineVersion || 19 ;
130132 porcupineVersion = porcupineVersion . replace ( "." , "" ) . trim ( ) ; //remove dot
131- importScripts ( './picovoice/porcupine-wasm-module-' + porcupineVersion + '.js' ) ;
133+ //importScripts('./picovoice/porcupine-wasm-module-' + porcupineVersion + '.js');
134+ if ( porcupineVersion <= 16 ) {
135+ importScripts ( './picovoice/porcupine-wasm-module-' + "14" + '.js' ) ; //we assume this works for 14-16?
136+ } else {
137+ importScripts ( './picovoice/porcupine-wasm-module-' + "19" + '.js' ) ; //this will probably fail for 17 and 18 (not supported)
138+ }
132139
133140 keywords = options . setup . keywords || [ "Computer" ] ;
134141 keywords . forEach ( function ( kw ) {
You can’t perform that action at this time.
0 commit comments