speech-opencode 1.1.6 → 1.1.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,qBAAqB,CAAA;AA8GvD,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAmVD,eAAO,MAAM,WAAW,GACrB,UAAS,kBAAuB,KAAG,MAwEnC,CAAA;;AAGH,wBAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,qBAAqB,CAAA;AA8GvD,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AA8WD,eAAO,MAAM,WAAW,GACrB,UAAS,kBAAuB,KAAG,MAwEnC,CAAA;;AAGH,wBAA4B"}
package/dist/index.js CHANGED
@@ -255,7 +255,34 @@ def main():
255
255
  print(f"[WakeWord] Detected! (score: {score:.3f})")
256
256
  TRIGGER_FILE.parent.mkdir(parents=True, exist_ok=True)
257
257
  TRIGGER_FILE.write_text("triggered")
258
- cooldown = int(SAMPLE_RATE / CHUNK_SIZE * 3) # 3 second cooldown
258
+
259
+ # Close stream temporarily to release device for recording
260
+ stream.stop_stream()
261
+ stream.close()
262
+
263
+ # Wait for recording to likely finish (e.g. 5 seconds)
264
+ import time
265
+ time.sleep(5)
266
+
267
+ # Re-open stream with retry logic
268
+ while running:
269
+ try:
270
+ stream = audio.open(
271
+ format=pyaudio.paInt16,
272
+ channels=1,
273
+ rate=sample_rate,
274
+ input=True,
275
+ input_device_index=device_index,
276
+ frames_per_buffer=CHUNK_SIZE,
277
+ )
278
+ print("[WakeWord] Resumed listening")
279
+ break
280
+ except Exception as e:
281
+ if running:
282
+ print(f"[WakeWord] Failed to re-open stream: {e}", file=sys.stderr)
283
+ time.sleep(1)
284
+
285
+ cooldown = 0
259
286
 
260
287
  except Exception as e:
261
288
  if running:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speech-opencode",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "Voice input plugin for OpenCode using OpenAI Whisper",
5
5
  "keywords": [
6
6
  "opencode",