@lumiastream/wakeword 1.0.1-alpha.11 → 1.0.1-alpha.12

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.
@@ -6,7 +6,6 @@ export default (options) => {
6
6
  }
7
7
 
8
8
  let args = [
9
- "--default-device",
10
9
  "--no-show-progress", // show no progress
11
10
  "--rate",
12
11
  options.sampleRate, // sample rate
@@ -44,7 +43,10 @@ export default (options) => {
44
43
  const spawnOptions = {};
45
44
 
46
45
  if (options.device) {
46
+ args.unshift("-t", "waveaudio", options.device);
47
47
  spawnOptions.env = { ...process.env, AUDIODEV: options.device };
48
+ } else {
49
+ args.unshift("--default-device");
48
50
  }
49
51
 
50
52
  return { cmd, args, spawnOptions };
package/lib/voice.js CHANGED
@@ -58,9 +58,12 @@ let rec = new Recognizer({ model, sampleRate: SAMPLE_RATE, grammar: GRAMMAR });
58
58
  /* ------------------------------------------------------------------ */
59
59
  /* 4. Start the microphone */
60
60
  /* ------------------------------------------------------------------ */
61
- const mic = record
62
- .record({ sampleRate: SAMPLE_RATE, threshold: 0, binPath: soxPath })
63
- .stream();
61
+ const recArgs = { sampleRate: SAMPLE_RATE, threshold: 0, binPath: soxPath };
62
+ if (process.platform === "win32") {
63
+ recArgs.device = "0";
64
+ }
65
+
66
+ const mic = record.record(recArgs).stream();
64
67
 
65
68
  mic.on("data", (buf) => {
66
69
  if (rec.acceptWaveform(buf)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/wakeword",
3
- "version": "1.0.1-alpha.11",
3
+ "version": "1.0.1-alpha.12",
4
4
  "type": "module",
5
5
  "main": "lib/voice.js",
6
6
  "bin": {