@elevenlabs/client 0.13.0 → 0.14.0-beta.0

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.
@@ -3,6 +3,7 @@ import type { AudioWorkletConfig } from "../BaseConversation";
3
3
  export type InputConfig = {
4
4
  preferHeadphonesForIosDevices?: boolean;
5
5
  inputDeviceId?: string;
6
+ onError?(message: string, context?: unknown): void;
6
7
  };
7
8
  export declare class Input {
8
9
  readonly context: AudioContext;
@@ -10,10 +11,15 @@ export declare class Input {
10
11
  readonly worklet: AudioWorkletNode;
11
12
  inputStream: MediaStream;
12
13
  private mediaStreamSource;
13
- static create({ sampleRate, format, preferHeadphonesForIosDevices, inputDeviceId, workletPaths, libsampleratePath, }: FormatConfig & InputConfig & AudioWorkletConfig): Promise<Input>;
14
+ private permissions;
15
+ private onError;
16
+ static create({ sampleRate, format, preferHeadphonesForIosDevices, inputDeviceId, workletPaths, libsampleratePath, onError, }: FormatConfig & InputConfig & AudioWorkletConfig): Promise<Input>;
14
17
  private static getDeviceIdConstraint;
15
18
  private constructor();
19
+ private forgetInputStreamAndSource;
16
20
  close(): Promise<void>;
17
21
  setMuted(isMuted: boolean): void;
22
+ private settingInput;
18
23
  setInputDevice(inputDeviceId?: string): Promise<void>;
24
+ private handlePermissionsChange;
19
25
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.13.0";
1
+ export declare const PACKAGE_VERSION = "0.14.0-beta.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/client",
3
- "version": "0.13.0",
3
+ "version": "0.14.0-beta.0",
4
4
  "description": "ElevenLabs JavaScript Client Library",
5
5
  "main": "./dist/lib.umd.js",
6
6
  "module": "./dist/lib.module.js",
@@ -44,11 +44,10 @@
44
44
  "scripts": {
45
45
  "generate-version": "printf \"// This file is auto-generated during build\\nexport const PACKAGE_VERSION = \\\"%s\\\";\\n\" \"$npm_package_version\" > src/version.ts",
46
46
  "generate-worklets": "node scripts/generateWorklets.js",
47
- "prebuild": "npm run generate-version && npm run generate-worklets",
48
- "build": "BROWSERSLIST_ENV=modern microbundle --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react src/index.ts",
47
+ "bundle": "microbundle --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react src/index.ts",
48
+ "build": "BROWSERSLIST_ENV=modern node --run bundle",
49
+ "dev": "BROWSERSLIST_ENV=development node --run bundle -- --watch --format modern",
49
50
  "clean": "rm -rf ./dist",
50
- "dev": "pnpm run clean && pnpm run generate-version && pnpm run generate-worklets && BROWSERSLIST_ENV=development microbundle --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react src/index.ts -w -f modern",
51
- "lint": "pnpm run lint:ts && pnpm run lint:es && pnpm run lint:prettier",
52
51
  "lint:ts": "tsc --noEmit --skipLibCheck",
53
52
  "lint:es": "pnpm exec eslint .",
54
53
  "lint:prettier": "prettier 'src/**/*.ts' --check",
@@ -50,7 +50,7 @@ class RawAudioProcessor extends AudioWorkletProcessor {
50
50
  case "setFormat":
51
51
  this.isMuted = false;
52
52
  this.buffer = []; // Initialize an empty buffer
53
- this.bufferSize = data.sampleRate / 4;
53
+ this.bufferSize = data.sampleRate / 10;
54
54
  this.format = data.format;
55
55
 
56
56
  if (globalThis.LibSampleRate && sampleRate !== data.sampleRate) {