@4players/odin-plugin-web 1.0.0-alpha.6 → 1.0.0-alpha.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.
Files changed (46) hide show
  1. package/{backend/lib → lib/plugin}/audioController.d.ts +3 -3
  2. package/{backend/lib → lib/plugin}/audioController.js +2 -2
  3. package/lib/wasm/index.js +19 -0
  4. package/{worker/lib → lib/worker}/common.d.ts +2 -1
  5. package/lib/worker/common.js +100 -0
  6. package/{worker/lib → lib/worker}/index.d.ts +1 -0
  7. package/lib/worker/index.js +2 -0
  8. package/{worker/lib → lib/worker}/messages.d.ts +1 -0
  9. package/lib/worker/messages.js +16 -0
  10. package/package.json +11 -12
  11. package/backend/lib/audioController.d.ts.map +0 -1
  12. package/backend/lib/audioController.js.map +0 -1
  13. package/backend/lib/config.d.ts.map +0 -1
  14. package/backend/lib/config.js.map +0 -1
  15. package/backend/lib/connectionPool.d.ts.map +0 -1
  16. package/backend/lib/connectionPool.js.map +0 -1
  17. package/backend/lib/index.d.ts.map +0 -1
  18. package/backend/lib/index.js.map +0 -1
  19. package/backend/lib/mainConnection.d.ts.map +0 -1
  20. package/backend/lib/mainConnection.js.map +0 -1
  21. package/backend/lib/roomConnection.d.ts.map +0 -1
  22. package/backend/lib/roomConnection.js.map +0 -1
  23. package/backend/lib/rpcConnection.d.ts.map +0 -1
  24. package/backend/lib/rpcConnection.js.map +0 -1
  25. package/backend/lib/token.d.ts.map +0 -1
  26. package/backend/lib/token.js.map +0 -1
  27. package/backend/package.json +0 -16
  28. package/wasm/lib/index.js +0 -19
  29. package/wasm/package.json +0 -14
  30. package/worker/lib/index.js +0 -2
  31. package/worker/package.json +0 -16
  32. /package/{backend/lib → lib/plugin}/config.d.ts +0 -0
  33. /package/{backend/lib → lib/plugin}/config.js +0 -0
  34. /package/{backend/lib → lib/plugin}/connectionPool.d.ts +0 -0
  35. /package/{backend/lib → lib/plugin}/connectionPool.js +0 -0
  36. /package/{backend/lib → lib/plugin}/index.d.ts +0 -0
  37. /package/{backend/lib → lib/plugin}/index.js +0 -0
  38. /package/{backend/lib → lib/plugin}/mainConnection.d.ts +0 -0
  39. /package/{backend/lib → lib/plugin}/mainConnection.js +0 -0
  40. /package/{backend/lib → lib/plugin}/roomConnection.d.ts +0 -0
  41. /package/{backend/lib → lib/plugin}/roomConnection.js +0 -0
  42. /package/{backend/lib → lib/plugin}/rpcConnection.d.ts +0 -0
  43. /package/{backend/lib → lib/plugin}/rpcConnection.js +0 -0
  44. /package/{backend/lib → lib/plugin}/token.d.ts +0 -0
  45. /package/{backend/lib → lib/plugin}/token.js +0 -0
  46. /package/{wasm/lib → lib/wasm}/index.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Backend, Strand } from '@4players/odin-common';
2
2
  import { DeviceParameters } from '.';
3
- import { CaptureSink, PlaybackId, PlaybackWorker } from '@4players/odin-plugin-web-worker';
3
+ import { CaptureSink, PlaybackId, PlaybackWorker } from '../worker';
4
4
  import { RoomConnection } from './roomConnection';
5
5
  export type Volume = Backend.Volume;
6
6
  export type Activity = Backend.Activity;
@@ -48,7 +48,7 @@ export declare class AudioController {
48
48
  createAudioPlayback(parameters: CreateAudioPlaybackParameters): Promise<AudioPlayback>;
49
49
  createAudioCapture(parameters: CreateAudioCaptureParameters): Promise<AudioCapture>;
50
50
  enumerateDevices(): Promise<Device[]>;
51
- playbackSetDevice(device: Device | undefined): Promise<void>;
51
+ playbackSetDevice(device?: Device): Promise<void>;
52
52
  playbackSetGlobalVolume(value: Backend.Volume): void;
53
53
  playbackStart(uid: string, id: GlobalMediaId): void;
54
54
  playbackStop(uid: string, id: GlobalMediaId): void;
@@ -87,7 +87,7 @@ export declare class AudioCapture implements Backend.AudioCapture {
87
87
  get vad(): Backend.VadConfig;
88
88
  get apm(): Backend.ApmConfig;
89
89
  get volume(): Backend.Volume;
90
- get activity(): import("@4players/odin-plugin-web-worker").Activity;
90
+ get activity(): import("../worker").Activity;
91
91
  get speechProbability(): number;
92
92
  constructor(controller: AudioController, parameters: CreateAudioCaptureParameters);
93
93
  start(room: RoomConnection, media: GlobalMediaId, uid: Backend.UID): void;
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { Strand, assert, failure, sleep, success, } from '@4players/odin-common';
11
- import { createCaptureWorker, createPlaybackWorker, silence, } from '@4players/odin-plugin-web-worker';
11
+ import { createCaptureWorker, createPlaybackWorker, silence, } from '../worker';
12
12
  const defaultVad = {
13
13
  voiceActivity: {
14
14
  attackThreshold: 0.9,
@@ -161,7 +161,7 @@ export class AudioController {
161
161
  else {
162
162
  audioContext = this.playbackWorker.audioContext;
163
163
  }
164
- if (audioContext.setSinkId !== undefined) {
164
+ if (audioContext.setSinkId !== undefined && device && audioContext.state === 'running') {
165
165
  yield audioContext.setSinkId(deviceId);
166
166
  }
167
167
  }));