@livekit/rtc-node 0.13.9 → 0.13.11
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.
- package/dist/audio_filter.cjs +48 -0
- package/dist/audio_filter.cjs.map +1 -0
- package/dist/audio_filter.d.cts +5 -0
- package/dist/audio_filter.d.ts +5 -0
- package/dist/audio_filter.d.ts.map +1 -0
- package/dist/audio_filter.js +27 -0
- package/dist/audio_filter.js.map +1 -0
- package/dist/audio_stream.cjs +15 -5
- package/dist/audio_stream.cjs.map +1 -1
- package/dist/audio_stream.d.cts +15 -2
- package/dist/audio_stream.d.ts +15 -2
- package/dist/audio_stream.d.ts.map +1 -1
- package/dist/audio_stream.js +15 -5
- package/dist/audio_stream.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/proto/audio_frame_pb.cjs +312 -2
- package/dist/proto/audio_frame_pb.cjs.map +1 -1
- package/dist/proto/audio_frame_pb.d.cts +278 -1
- package/dist/proto/audio_frame_pb.d.ts +278 -1
- package/dist/proto/audio_frame_pb.d.ts.map +1 -1
- package/dist/proto/audio_frame_pb.js +301 -2
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/ffi_pb.cjs +12 -2
- package/dist/proto/ffi_pb.cjs.map +1 -1
- package/dist/proto/ffi_pb.d.cts +65 -1
- package/dist/proto/ffi_pb.d.ts +65 -1
- package/dist/proto/ffi_pb.d.ts.map +1 -1
- package/dist/proto/ffi_pb.js +13 -3
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/video_frame.cjs +3 -1
- package/dist/video_frame.cjs.map +1 -1
- package/dist/video_frame.d.ts.map +1 -1
- package/dist/video_frame.js +4 -2
- package/dist/video_frame.js.map +1 -1
- package/package.json +6 -6
- package/src/audio_filter.ts +29 -0
- package/src/audio_stream.ts +38 -5
- package/src/index.ts +2 -0
- package/src/proto/audio_frame_pb.ts +533 -0
- package/src/proto/ffi_pb.ts +75 -1
- package/src/version.ts +1 -1
- package/src/video_frame.ts +5 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var audio_filter_exports = {};
|
|
20
|
+
__export(audio_filter_exports, {
|
|
21
|
+
AudioFilter: () => AudioFilter
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(audio_filter_exports);
|
|
24
|
+
var import_ffi_client = require("./ffi_client.cjs");
|
|
25
|
+
var import_audio_frame_pb = require("./proto/audio_frame_pb.cjs");
|
|
26
|
+
class AudioFilter {
|
|
27
|
+
constructor(moduleId, path, dependencies = []) {
|
|
28
|
+
const req = new import_audio_frame_pb.LoadAudioFilterPluginRequest({
|
|
29
|
+
moduleId,
|
|
30
|
+
pluginPath: path,
|
|
31
|
+
dependencies
|
|
32
|
+
});
|
|
33
|
+
const res = import_ffi_client.FfiClient.instance.request({
|
|
34
|
+
message: {
|
|
35
|
+
case: "loadAudioFilterPlugin",
|
|
36
|
+
value: req
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (res.error) {
|
|
40
|
+
throw new Error(`Failed to initialize audio filter: ${res.error}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
AudioFilter
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=audio_filter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/audio_filter.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { FfiClient } from './ffi_client.js';\nimport {\n LoadAudioFilterPluginRequest,\n LoadAudioFilterPluginResponse,\n} from './proto/audio_frame_pb.js';\n\nexport class AudioFilter {\n constructor(moduleId: string, path: string, dependencies: string[] = []) {\n const req = new LoadAudioFilterPluginRequest({\n moduleId,\n pluginPath: path,\n dependencies,\n });\n\n const res = FfiClient.instance.request<LoadAudioFilterPluginResponse>({\n message: {\n case: 'loadAudioFilterPlugin',\n value: req,\n },\n });\n\n if (res.error) {\n throw new Error(`Failed to initialize audio filter: ${res.error}`);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA0B;AAC1B,4BAGO;AAEA,MAAM,YAAY;AAAA,EACvB,YAAY,UAAkB,MAAc,eAAyB,CAAC,GAAG;AACvE,UAAM,MAAM,IAAI,mDAA6B;AAAA,MAC3C;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,IACF,CAAC;AAED,UAAM,MAAM,4BAAU,SAAS,QAAuC;AAAA,MACpE,SAAS;AAAA,QACP,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF,CAAC;AAED,QAAI,IAAI,OAAO;AACb,YAAM,IAAI,MAAM,sCAAsC,IAAI,KAAK,EAAE;AAAA,IACnE;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio_filter.d.ts","sourceRoot":"","sources":["../src/audio_filter.ts"],"names":[],"mappings":"AASA,qBAAa,WAAW;gBACV,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,GAAE,MAAM,EAAO;CAkBxE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FfiClient } from "./ffi_client.js";
|
|
2
|
+
import {
|
|
3
|
+
LoadAudioFilterPluginRequest,
|
|
4
|
+
LoadAudioFilterPluginResponse
|
|
5
|
+
} from "./proto/audio_frame_pb.js";
|
|
6
|
+
class AudioFilter {
|
|
7
|
+
constructor(moduleId, path, dependencies = []) {
|
|
8
|
+
const req = new LoadAudioFilterPluginRequest({
|
|
9
|
+
moduleId,
|
|
10
|
+
pluginPath: path,
|
|
11
|
+
dependencies
|
|
12
|
+
});
|
|
13
|
+
const res = FfiClient.instance.request({
|
|
14
|
+
message: {
|
|
15
|
+
case: "loadAudioFilterPlugin",
|
|
16
|
+
value: req
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if (res.error) {
|
|
20
|
+
throw new Error(`Failed to initialize audio filter: ${res.error}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
AudioFilter
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=audio_filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/audio_filter.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { FfiClient } from './ffi_client.js';\nimport {\n LoadAudioFilterPluginRequest,\n LoadAudioFilterPluginResponse,\n} from './proto/audio_frame_pb.js';\n\nexport class AudioFilter {\n constructor(moduleId: string, path: string, dependencies: string[] = []) {\n const req = new LoadAudioFilterPluginRequest({\n moduleId,\n pluginPath: path,\n dependencies,\n });\n\n const res = FfiClient.instance.request<LoadAudioFilterPluginResponse>({\n message: {\n case: 'loadAudioFilterPlugin',\n value: req,\n },\n });\n\n if (res.error) {\n throw new Error(`Failed to initialize audio filter: ${res.error}`);\n }\n }\n}\n"],"mappings":"AAGA,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEA,MAAM,YAAY;AAAA,EACvB,YAAY,UAAkB,MAAc,eAAyB,CAAC,GAAG;AACvE,UAAM,MAAM,IAAI,6BAA6B;AAAA,MAC3C;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,IACF,CAAC;AAED,UAAM,MAAM,UAAU,SAAS,QAAuC;AAAA,MACpE,SAAS;AAAA,QACP,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF,CAAC;AAED,QAAI,IAAI,OAAO;AACb,YAAM,IAAI,MAAM,sCAAsC,IAAI,KAAK,EAAE;AAAA,IACnE;AAAA,EACF;AACF;","names":[]}
|
package/dist/audio_stream.cjs
CHANGED
|
@@ -26,7 +26,7 @@ var import_audio_frame = require("./audio_frame.cjs");
|
|
|
26
26
|
var import_ffi_client = require("./ffi_client.cjs");
|
|
27
27
|
var import_audio_frame_pb = require("./proto/audio_frame_pb.cjs");
|
|
28
28
|
class AudioStream {
|
|
29
|
-
constructor(track,
|
|
29
|
+
constructor(track, sampleRateOrOptions, numChannels) {
|
|
30
30
|
/** @internal */
|
|
31
31
|
this.eventQueue = [];
|
|
32
32
|
/** @internal */
|
|
@@ -54,13 +54,23 @@ class AudioStream {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
this.track = track;
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
if (sampleRateOrOptions !== void 0 && typeof sampleRateOrOptions !== "number") {
|
|
58
|
+
this.sampleRate = sampleRateOrOptions.sampleRate ?? 48e3;
|
|
59
|
+
this.numChannels = sampleRateOrOptions.numChannels ?? 1;
|
|
60
|
+
this.ncOptions = sampleRateOrOptions.noiseCancellation;
|
|
61
|
+
} else {
|
|
62
|
+
this.sampleRate = sampleRateOrOptions ?? 48e3;
|
|
63
|
+
this.numChannels = numChannels ?? 1;
|
|
64
|
+
}
|
|
59
65
|
const req = new import_audio_frame_pb.NewAudioStreamRequest({
|
|
60
66
|
type: import_audio_frame_pb.AudioStreamType.AUDIO_STREAM_NATIVE,
|
|
61
67
|
trackHandle: track.ffi_handle.handle,
|
|
62
|
-
sampleRate,
|
|
63
|
-
numChannels
|
|
68
|
+
sampleRate: this.sampleRate,
|
|
69
|
+
numChannels: this.numChannels,
|
|
70
|
+
...this.ncOptions ? {
|
|
71
|
+
audioFilterModuleId: this.ncOptions.moduleId,
|
|
72
|
+
audioFilterOptions: JSON.stringify(this.ncOptions.options)
|
|
73
|
+
} : {}
|
|
64
74
|
});
|
|
65
75
|
const res = import_ffi_client.FfiClient.instance.request({
|
|
66
76
|
message: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/audio_stream.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { Mutex } from '@livekit/mutex';\nimport { AudioFrame } from './audio_frame.js';\nimport type { FfiEvent } from './ffi_client.js';\nimport { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';\nimport type { AudioStreamInfo, NewAudioStreamResponse } from './proto/audio_frame_pb.js';\nimport { AudioStreamType, NewAudioStreamRequest } from './proto/audio_frame_pb.js';\nimport type { Track } from './track.js';\n\nexport class AudioStream implements AsyncIterableIterator<AudioFrame> {\n /** @internal */\n info: AudioStreamInfo;\n /** @internal */\n ffiHandle: FfiHandle;\n /** @internal */\n eventQueue: (AudioFrame | null)[] = [];\n /** @internal */\n queueResolve: ((value: IteratorResult<AudioFrame>) => void) | null = null;\n /** @internal */\n mutex = new Mutex();\n\n track: Track;\n sampleRate: number;\n numChannels: number;\n\n constructor(track: Track, sampleRate: number
|
|
1
|
+
{"version":3,"sources":["../src/audio_stream.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { Mutex } from '@livekit/mutex';\nimport { AudioFrame } from './audio_frame.js';\nimport type { FfiEvent } from './ffi_client.js';\nimport { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';\nimport type { AudioStreamInfo, NewAudioStreamResponse } from './proto/audio_frame_pb.js';\nimport { AudioStreamType, NewAudioStreamRequest } from './proto/audio_frame_pb.js';\nimport type { Track } from './track.js';\n\nexport interface AudioStreamOptions {\n noiseCancellation?: NoiseCancellationOptions;\n sampleRate?: number;\n numChannels?: number;\n}\n\nexport interface NoiseCancellationOptions {\n moduleId: string;\n options: Record<string, any>;\n}\n\nexport class AudioStream implements AsyncIterableIterator<AudioFrame> {\n /** @internal */\n info: AudioStreamInfo;\n /** @internal */\n ffiHandle: FfiHandle;\n /** @internal */\n eventQueue: (AudioFrame | null)[] = [];\n /** @internal */\n queueResolve: ((value: IteratorResult<AudioFrame>) => void) | null = null;\n /** @internal */\n mutex = new Mutex();\n\n track: Track;\n sampleRate: number;\n numChannels: number;\n ncOptions?: NoiseCancellationOptions;\n\n constructor(track: Track);\n constructor(track: Track, sampleRate: number);\n constructor(track: Track, sampleRate: number, numChannels: number);\n constructor(track: Track, options: AudioStreamOptions);\n\n constructor(\n track: Track,\n sampleRateOrOptions?: number | AudioStreamOptions,\n numChannels?: number,\n ) {\n this.track = track;\n if (sampleRateOrOptions !== undefined && typeof sampleRateOrOptions !== 'number') {\n this.sampleRate = sampleRateOrOptions.sampleRate ?? 48000;\n this.numChannels = sampleRateOrOptions.numChannels ?? 1;\n this.ncOptions = sampleRateOrOptions.noiseCancellation;\n } else {\n this.sampleRate = (sampleRateOrOptions as number) ?? 48000;\n this.numChannels = numChannels ?? 1;\n }\n\n const req = new NewAudioStreamRequest({\n type: AudioStreamType.AUDIO_STREAM_NATIVE,\n trackHandle: track.ffi_handle.handle,\n sampleRate: this.sampleRate,\n numChannels: this.numChannels,\n ...(this.ncOptions\n ? {\n audioFilterModuleId: this.ncOptions.moduleId,\n audioFilterOptions: JSON.stringify(this.ncOptions.options),\n }\n : {}),\n });\n\n const res = FfiClient.instance.request<NewAudioStreamResponse>({\n message: {\n case: 'newAudioStream',\n value: req,\n },\n });\n\n this.info = res.stream!.info!;\n this.ffiHandle = new FfiHandle(res.stream!.handle!.id!);\n\n FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onEvent);\n }\n\n private onEvent = (ev: FfiEvent) => {\n if (\n ev.message.case != 'audioStreamEvent' ||\n ev.message.value.streamHandle != this.ffiHandle.handle\n ) {\n return;\n }\n\n const streamEvent = ev.message.value.message;\n switch (streamEvent.case) {\n case 'frameReceived':\n const frame = AudioFrame.fromOwnedInfo(streamEvent.value.frame!);\n if (this.queueResolve) {\n this.queueResolve({ done: false, value: frame });\n this.queueResolve = null;\n } else {\n this.eventQueue.push(frame);\n }\n break;\n case 'eos':\n FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);\n break;\n }\n };\n\n async next(): Promise<IteratorResult<AudioFrame>> {\n const unlock = await this.mutex.lock();\n if (this.eventQueue.length > 0) {\n unlock();\n const value = this.eventQueue.shift();\n if (value) {\n return { done: false, value };\n } else {\n return { done: true, value: undefined };\n }\n }\n const promise = new Promise<IteratorResult<AudioFrame>>(\n (resolve) => (this.queueResolve = resolve),\n );\n unlock();\n return promise;\n }\n\n close() {\n this.eventQueue.push(null);\n this.ffiHandle.dispose();\n }\n\n [Symbol.asyncIterator](): AudioStream {\n return this;\n }\n}\n"],"m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B,KAAK,UAAU,KAAK,UAAU,OAAO;AAAA,MAC3D,IACA,CAAC;AAAA,IACP,CAAC;AAED,UAAM,MAAM,4BAAU,SAAS,QAAgC;AAAA,MAC7D,SAAS;AAAA,QACP,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF,CAAC;AAED,SAAK,OAAO,IAAI,OAAQ;AACxB,SAAK,YAAY,IAAI,4BAAU,IAAI,OAAQ,OAAQ,EAAG;AAEtD,gCAAU,SAAS,GAAG,iCAAe,UAAU,KAAK,OAAO;AAAA,EAC7D;AAAA,EA2BA,MAAM,OAA4C;AAChD,UAAM,SAAS,MAAM,KAAK,MAAM,KAAK;AACrC,QAAI,KAAK,WAAW,SAAS,GAAG;AAC9B,aAAO;AACP,YAAM,QAAQ,KAAK,WAAW,MAAM;AACpC,UAAI,OAAO;AACT,eAAO,EAAE,MAAM,OAAO,MAAM;AAAA,MAC9B,OAAO;AACL,eAAO,EAAE,MAAM,MAAM,OAAO,OAAU;AAAA,MACxC;AAAA,IACF;AACA,UAAM,UAAU,IAAI;AAAA,MAClB,CAAC,YAAa,KAAK,eAAe;AAAA,IACpC;AACA,WAAO;AACP,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ;AACN,SAAK,WAAW,KAAK,IAAI;AACzB,SAAK,UAAU,QAAQ;AAAA,EACzB;AAAA,EAEA,CAAC,OAAO,aAAa,IAAiB;AACpC,WAAO;AAAA,EACT;AACF;","names":[]}
|
package/dist/audio_stream.d.cts
CHANGED
|
@@ -13,6 +13,15 @@ import './video_source.cjs';
|
|
|
13
13
|
import './proto/video_frame_pb.cjs';
|
|
14
14
|
import './video_frame.cjs';
|
|
15
15
|
|
|
16
|
+
interface AudioStreamOptions {
|
|
17
|
+
noiseCancellation?: NoiseCancellationOptions;
|
|
18
|
+
sampleRate?: number;
|
|
19
|
+
numChannels?: number;
|
|
20
|
+
}
|
|
21
|
+
interface NoiseCancellationOptions {
|
|
22
|
+
moduleId: string;
|
|
23
|
+
options: Record<string, any>;
|
|
24
|
+
}
|
|
16
25
|
declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
|
|
17
26
|
/** @internal */
|
|
18
27
|
info: AudioStreamInfo;
|
|
@@ -27,11 +36,15 @@ declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
|
|
|
27
36
|
track: Track;
|
|
28
37
|
sampleRate: number;
|
|
29
38
|
numChannels: number;
|
|
30
|
-
|
|
39
|
+
ncOptions?: NoiseCancellationOptions;
|
|
40
|
+
constructor(track: Track);
|
|
41
|
+
constructor(track: Track, sampleRate: number);
|
|
42
|
+
constructor(track: Track, sampleRate: number, numChannels: number);
|
|
43
|
+
constructor(track: Track, options: AudioStreamOptions);
|
|
31
44
|
private onEvent;
|
|
32
45
|
next(): Promise<IteratorResult<AudioFrame>>;
|
|
33
46
|
close(): void;
|
|
34
47
|
[Symbol.asyncIterator](): AudioStream;
|
|
35
48
|
}
|
|
36
49
|
|
|
37
|
-
export { AudioStream };
|
|
50
|
+
export { AudioStream, type AudioStreamOptions, type NoiseCancellationOptions };
|
package/dist/audio_stream.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ import './video_source.js';
|
|
|
13
13
|
import './proto/video_frame_pb.js';
|
|
14
14
|
import './video_frame.js';
|
|
15
15
|
|
|
16
|
+
interface AudioStreamOptions {
|
|
17
|
+
noiseCancellation?: NoiseCancellationOptions;
|
|
18
|
+
sampleRate?: number;
|
|
19
|
+
numChannels?: number;
|
|
20
|
+
}
|
|
21
|
+
interface NoiseCancellationOptions {
|
|
22
|
+
moduleId: string;
|
|
23
|
+
options: Record<string, any>;
|
|
24
|
+
}
|
|
16
25
|
declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
|
|
17
26
|
/** @internal */
|
|
18
27
|
info: AudioStreamInfo;
|
|
@@ -27,11 +36,15 @@ declare class AudioStream implements AsyncIterableIterator<AudioFrame> {
|
|
|
27
36
|
track: Track;
|
|
28
37
|
sampleRate: number;
|
|
29
38
|
numChannels: number;
|
|
30
|
-
|
|
39
|
+
ncOptions?: NoiseCancellationOptions;
|
|
40
|
+
constructor(track: Track);
|
|
41
|
+
constructor(track: Track, sampleRate: number);
|
|
42
|
+
constructor(track: Track, sampleRate: number, numChannels: number);
|
|
43
|
+
constructor(track: Track, options: AudioStreamOptions);
|
|
31
44
|
private onEvent;
|
|
32
45
|
next(): Promise<IteratorResult<AudioFrame>>;
|
|
33
46
|
close(): void;
|
|
34
47
|
[Symbol.asyncIterator](): AudioStream;
|
|
35
48
|
}
|
|
36
49
|
|
|
37
|
-
export { AudioStream };
|
|
50
|
+
export { AudioStream, type AudioStreamOptions, type NoiseCancellationOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio_stream.d.ts","sourceRoot":"","sources":["../src/audio_stream.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,2BAA2B,CAAC;AAEzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,qBAAa,WAAY,YAAW,qBAAqB,CAAC,UAAU,CAAC;IACnE,gBAAgB;IAChB,IAAI,EAAE,eAAe,CAAC;IACtB,gBAAgB;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB;IAChB,UAAU,EAAE,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,CAAM;IACvC,gBAAgB;IAChB,YAAY,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IAC1E,gBAAgB;IAChB,KAAK,QAAe;IAEpB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;
|
|
1
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EAAE,WAAW,EAAE,MAAM;gBACrD,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB;IA2CrD,OAAO,CAAC,OAAO,CAuBb;IAEI,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAkBjD,KAAK;IAKL,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW;CAGtC"}
|
package/dist/audio_stream.js
CHANGED
|
@@ -3,7 +3,7 @@ import { AudioFrame } from "./audio_frame.js";
|
|
|
3
3
|
import { FfiClient, FfiClientEvent, FfiHandle } from "./ffi_client.js";
|
|
4
4
|
import { AudioStreamType, NewAudioStreamRequest } from "./proto/audio_frame_pb.js";
|
|
5
5
|
class AudioStream {
|
|
6
|
-
constructor(track,
|
|
6
|
+
constructor(track, sampleRateOrOptions, numChannels) {
|
|
7
7
|
/** @internal */
|
|
8
8
|
this.eventQueue = [];
|
|
9
9
|
/** @internal */
|
|
@@ -31,13 +31,23 @@ class AudioStream {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
this.track = track;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
if (sampleRateOrOptions !== void 0 && typeof sampleRateOrOptions !== "number") {
|
|
35
|
+
this.sampleRate = sampleRateOrOptions.sampleRate ?? 48e3;
|
|
36
|
+
this.numChannels = sampleRateOrOptions.numChannels ?? 1;
|
|
37
|
+
this.ncOptions = sampleRateOrOptions.noiseCancellation;
|
|
38
|
+
} else {
|
|
39
|
+
this.sampleRate = sampleRateOrOptions ?? 48e3;
|
|
40
|
+
this.numChannels = numChannels ?? 1;
|
|
41
|
+
}
|
|
36
42
|
const req = new NewAudioStreamRequest({
|
|
37
43
|
type: AudioStreamType.AUDIO_STREAM_NATIVE,
|
|
38
44
|
trackHandle: track.ffi_handle.handle,
|
|
39
|
-
sampleRate,
|
|
40
|
-
numChannels
|
|
45
|
+
sampleRate: this.sampleRate,
|
|
46
|
+
numChannels: this.numChannels,
|
|
47
|
+
...this.ncOptions ? {
|
|
48
|
+
audioFilterModuleId: this.ncOptions.moduleId,
|
|
49
|
+
audioFilterOptions: JSON.stringify(this.ncOptions.options)
|
|
50
|
+
} : {}
|
|
41
51
|
});
|
|
42
52
|
const res = FfiClient.instance.request({
|
|
43
53
|
message: {
|
package/dist/audio_stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/audio_stream.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { Mutex } from '@livekit/mutex';\nimport { AudioFrame } from './audio_frame.js';\nimport type { FfiEvent } from './ffi_client.js';\nimport { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';\nimport type { AudioStreamInfo, NewAudioStreamResponse } from './proto/audio_frame_pb.js';\nimport { AudioStreamType, NewAudioStreamRequest } from './proto/audio_frame_pb.js';\nimport type { Track } from './track.js';\n\nexport class AudioStream implements AsyncIterableIterator<AudioFrame> {\n /** @internal */\n info: AudioStreamInfo;\n /** @internal */\n ffiHandle: FfiHandle;\n /** @internal */\n eventQueue: (AudioFrame | null)[] = [];\n /** @internal */\n queueResolve: ((value: IteratorResult<AudioFrame>) => void) | null = null;\n /** @internal */\n mutex = new Mutex();\n\n track: Track;\n sampleRate: number;\n numChannels: number;\n\n constructor(track: Track, sampleRate: number
|
|
1
|
+
{"version":3,"sources":["../src/audio_stream.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { Mutex } from '@livekit/mutex';\nimport { AudioFrame } from './audio_frame.js';\nimport type { FfiEvent } from './ffi_client.js';\nimport { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';\nimport type { AudioStreamInfo, NewAudioStreamResponse } from './proto/audio_frame_pb.js';\nimport { AudioStreamType, NewAudioStreamRequest } from './proto/audio_frame_pb.js';\nimport type { Track } from './track.js';\n\nexport interface AudioStreamOptions {\n noiseCancellation?: NoiseCancellationOptions;\n sampleRate?: number;\n numChannels?: number;\n}\n\nexport interface NoiseCancellationOptions {\n moduleId: string;\n options: Record<string, any>;\n}\n\nexport class AudioStream implements AsyncIterableIterator<AudioFrame> {\n /** @internal */\n info: AudioStreamInfo;\n /** @internal */\n ffiHandle: FfiHandle;\n /** @internal */\n eventQueue: (AudioFrame | null)[] = [];\n /** @internal */\n queueResolve: ((value: IteratorResult<AudioFrame>) => void) | null = null;\n /** @internal */\n mutex = new Mutex();\n\n track: Track;\n sampleRate: number;\n numChannels: number;\n ncOptions?: NoiseCancellationOptions;\n\n constructor(track: Track);\n constructor(track: Track, sampleRate: number);\n constructor(track: Track, sampleRate: number, numChannels: number);\n constructor(track: Track, options: AudioStreamOptions);\n\n constructor(\n track: Track,\n sampleRateOrOptions?: number | AudioStreamOptions,\n numChannels?: number,\n ) {\n this.track = track;\n if (sampleRateOrOptions !== undefined && typeof sampleRateOrOptions !== 'number') {\n this.sampleRate = sampleRateOrOptions.sampleRate ?? 48000;\n this.numChannels = sampleRateOrOptions.numChannels ?? 1;\n this.ncOptions = sampleRateOrOptions.noiseCancellation;\n } else {\n this.sampleRate = (sampleRateOrOptions as number) ?? 48000;\n this.numChannels = numChannels ?? 1;\n }\n\n const req = new NewAudioStreamRequest({\n type: AudioStreamType.AUDIO_STREAM_NATIVE,\n trackHandle: track.ffi_handle.handle,\n sampleRate: this.sampleRate,\n numChannels: this.numChannels,\n ...(this.ncOptions\n ? {\n audioFilterModuleId: this.ncOptions.moduleId,\n audioFilterOptions: JSON.stringify(this.ncOptions.options),\n }\n : {}),\n });\n\n const res = FfiClient.instance.request<NewAudioStreamResponse>({\n message: {\n case: 'newAudioStream',\n value: req,\n },\n });\n\n this.info = res.stream!.info!;\n this.ffiHandle = new FfiHandle(res.stream!.handle!.id!);\n\n FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onEvent);\n }\n\n private onEvent = (ev: FfiEvent) => {\n if (\n ev.message.case != 'audioStreamEvent' ||\n ev.message.value.streamHandle != this.ffiHandle.handle\n ) {\n return;\n }\n\n const streamEvent = ev.message.value.message;\n switch (streamEvent.case) {\n case 'frameReceived':\n const frame = AudioFrame.fromOwnedInfo(streamEvent.value.frame!);\n if (this.queueResolve) {\n this.queueResolve({ done: false, value: frame });\n this.queueResolve = null;\n } else {\n this.eventQueue.push(frame);\n }\n break;\n case 'eos':\n FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);\n break;\n }\n };\n\n async next(): Promise<IteratorResult<AudioFrame>> {\n const unlock = await this.mutex.lock();\n if (this.eventQueue.length > 0) {\n unlock();\n const value = this.eventQueue.shift();\n if (value) {\n return { done: false, value };\n } else {\n return { done: true, value: undefined };\n }\n }\n const promise = new Promise<IteratorResult<AudioFrame>>(\n (resolve) => (this.queueResolve = resolve),\n );\n unlock();\n return promise;\n }\n\n close() {\n this.eventQueue.push(null);\n this.ffiHandle.dispose();\n }\n\n [Symbol.asyncIterator](): AudioStream {\n return this;\n }\n}\n"],"mappings":"AAGA,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAE3B,SAAS,WAAW,gBAAgB,iBAAiB;AAErD,SAAS,iBAAiB,6BAA6B;AAchD,MAAM,YAAyD;AAAA,EAsBpE,YACE,OACA,qBACA,aACA;AApBF;AAAA,sBAAoC,CAAC;AAErC;AAAA,wBAAqE;AAErE;AAAA,iBAAQ,IAAI,MAAM;AAqDlB,SAAQ,UAAU,CAAC,OAAiB;AAClC,UACE,GAAG,QAAQ,QAAQ,sBACnB,GAAG,QAAQ,MAAM,gBAAgB,KAAK,UAAU,QAChD;AACA;AAAA,MACF;AAEA,YAAM,cAAc,GAAG,QAAQ,MAAM;AACrC,cAAQ,YAAY,MAAM;AAAA,QACxB,KAAK;AACH,gBAAM,QAAQ,WAAW,cAAc,YAAY,MAAM,KAAM;AAC/D,cAAI,KAAK,cAAc;AACrB,iBAAK,aAAa,EAAE,MAAM,OAAO,OAAO,MAAM,CAAC;AAC/C,iBAAK,eA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ACxC;AAAA,IACF;AACA,UAAM,UAAU,IAAI;AAAA,MAClB,CAAC,YAAa,KAAK,eAAe;AAAA,IACpC;AACA,WAAO;AACP,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ;AACN,SAAK,WAAW,KAAK,IAAI;AACzB,SAAK,UAAU,QAAQ;AAAA,EACzB;AAAA,EAEA,CAAC,OAAO,aAAa,IAAiB;AACpC,WAAO;AAAA,EACT;AACF;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -19,6 +19,7 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var index_exports = {};
|
|
21
21
|
__export(index_exports, {
|
|
22
|
+
AudioFilter: () => import_audio_filter.AudioFilter,
|
|
22
23
|
AudioFrame: () => import_audio_frame.AudioFrame,
|
|
23
24
|
AudioResampler: () => import_audio_resampler.AudioResampler,
|
|
24
25
|
AudioResamplerQuality: () => import_audio_resampler.AudioResamplerQuality,
|
|
@@ -70,6 +71,7 @@ var import_audio_frame = require("./audio_frame.cjs");
|
|
|
70
71
|
var import_audio_resampler = require("./audio_resampler.cjs");
|
|
71
72
|
var import_audio_source = require("./audio_source.cjs");
|
|
72
73
|
var import_audio_stream = require("./audio_stream.cjs");
|
|
74
|
+
var import_audio_filter = require("./audio_filter.cjs");
|
|
73
75
|
__reExport(index_exports, require("./data_streams/index.cjs"), module.exports);
|
|
74
76
|
var import_e2ee = require("./e2ee.cjs");
|
|
75
77
|
var import_ffi_client = require("./ffi_client.cjs");
|
|
@@ -88,6 +90,7 @@ var import_video_source = require("./video_source.cjs");
|
|
|
88
90
|
var import_video_stream = require("./video_stream.cjs");
|
|
89
91
|
// Annotate the CommonJS export names for ESM import in node:
|
|
90
92
|
0 && (module.exports = {
|
|
93
|
+
AudioFilter,
|
|
91
94
|
AudioFrame,
|
|
92
95
|
AudioResampler,
|
|
93
96
|
AudioResamplerQuality,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { AudioSource } from './audio_source.js';\nexport { AudioStream } from './audio_stream.js';\nexport * from './data_streams/index.js';\nexport { E2EEManager, FrameCryptor, KeyProvider } from './e2ee.js';\nexport type { E2EEOptions, KeyProviderOptions } from './e2ee.js';\nexport { dispose } from './ffi_client.js';\nexport { LocalParticipant, Participant, RemoteParticipant } from './participant.js';\nexport { EncryptionState, EncryptionType } from './proto/e2ee_pb.js';\nexport { DisconnectReason, ParticipantKind } from './proto/participant_pb.js';\nexport {\n ConnectionQuality,\n ConnectionState,\n ContinualGatheringPolicy,\n DataPacketKind,\n IceServer,\n IceTransportType,\n TrackPublishOptions,\n} from './proto/room_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoCodec, VideoRotation } from './proto/video_frame_pb.js';\nexport { ConnectError, Room, RoomEvent, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { RpcError, type PerformRpcParams, type RpcInvocationData } from './rpc.js';\nexport {\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n Track,\n type AudioTrack,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n} from './track.js';\nexport {\n LocalTrackPublication,\n RemoteTrackPublication,\n TrackPublication,\n} from './track_publication.js';\nexport type { Transcription, TranscriptionSegment } from './transcription.js';\nexport type { ChatMessage } from './types.js';\nexport { VideoFrame } from './video_frame.js';\nexport { VideoSource } from './video_source.js';\nexport { VideoStream, type VideoFrameEvent } from './video_stream.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,yBAA+C;AAC/C,6BAAsD;AACtD,0BAA4B;AAC5B,0BAA4B;AAC5B,0BAAc,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { AudioSource } from './audio_source.js';\nexport { AudioStream } from './audio_stream.js';\nexport type { NoiseCancellationOptions } from './audio_stream.js';\nexport { AudioFilter } from './audio_filter.js';\nexport * from './data_streams/index.js';\nexport { E2EEManager, FrameCryptor, KeyProvider } from './e2ee.js';\nexport type { E2EEOptions, KeyProviderOptions } from './e2ee.js';\nexport { dispose } from './ffi_client.js';\nexport { LocalParticipant, Participant, RemoteParticipant } from './participant.js';\nexport { EncryptionState, EncryptionType } from './proto/e2ee_pb.js';\nexport { DisconnectReason, ParticipantKind } from './proto/participant_pb.js';\nexport {\n ConnectionQuality,\n ConnectionState,\n ContinualGatheringPolicy,\n DataPacketKind,\n IceServer,\n IceTransportType,\n TrackPublishOptions,\n} from './proto/room_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoCodec, VideoRotation } from './proto/video_frame_pb.js';\nexport { ConnectError, Room, RoomEvent, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { RpcError, type PerformRpcParams, type RpcInvocationData } from './rpc.js';\nexport {\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n Track,\n type AudioTrack,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n} from './track.js';\nexport {\n LocalTrackPublication,\n RemoteTrackPublication,\n TrackPublication,\n} from './track_publication.js';\nexport type { Transcription, TranscriptionSegment } from './transcription.js';\nexport type { ChatMessage } from './types.js';\nexport { VideoFrame } from './video_frame.js';\nexport { VideoSource } from './video_source.js';\nexport { VideoStream, type VideoFrameEvent } from './video_stream.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,yBAA+C;AAC/C,6BAAsD;AACtD,0BAA4B;AAC5B,0BAA4B;AAE5B,0BAA4B;AAC5B,0BAAc,oCAVd;AAWA,kBAAuD;AAEvD,wBAAwB;AACxB,yBAAiE;AACjE,qBAAgD;AAChD,4BAAkD;AAClD,qBAQO;AACP,sBAAoD;AACpD,4BAA2D;AAC3D,kBAAuF;AACvF,iBAAwE;AACxE,mBAUO;AACP,+BAIO;AAGP,yBAA2B;AAC3B,0BAA4B;AAC5B,0BAAkD;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { AudioFrame, combineAudioFrames } from './audio_frame.cjs';
|
|
2
2
|
export { AudioResampler, AudioResamplerQuality } from './audio_resampler.cjs';
|
|
3
3
|
export { AudioSource } from './audio_source.cjs';
|
|
4
|
-
export { AudioStream } from './audio_stream.cjs';
|
|
4
|
+
export { AudioStream, NoiseCancellationOptions } from './audio_stream.cjs';
|
|
5
|
+
export { AudioFilter } from './audio_filter.cjs';
|
|
5
6
|
export { a as BaseStreamInfo, f as ByteStreamHandler, b as ByteStreamInfo, e as ByteStreamOptions, B as ByteStreamReader, D as DataStreamOptions, S as StreamController, g as TextStreamHandler, c as TextStreamInfo, d as TextStreamOptions, T as TextStreamReader } from './stream_reader-a8_oiaOi.cjs';
|
|
6
7
|
export { ByteStreamWriter, TextStreamWriter } from './data_streams/stream_writer.cjs';
|
|
7
8
|
export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { AudioFrame, combineAudioFrames } from './audio_frame.js';
|
|
2
2
|
export { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';
|
|
3
3
|
export { AudioSource } from './audio_source.js';
|
|
4
|
-
export { AudioStream } from './audio_stream.js';
|
|
4
|
+
export { AudioStream, NoiseCancellationOptions } from './audio_stream.js';
|
|
5
|
+
export { AudioFilter } from './audio_filter.js';
|
|
5
6
|
export { a as BaseStreamInfo, f as ByteStreamHandler, b as ByteStreamInfo, e as ByteStreamOptions, B as ByteStreamReader, D as DataStreamOptions, S as StreamController, g as TextStreamHandler, c as TextStreamInfo, d as TextStreamOptions, T as TextStreamReader } from './stream_reader-DWUV4eJB.js';
|
|
6
7
|
export { ByteStreamWriter, TextStreamWriter } from './data_streams/stream_writer.js';
|
|
7
8
|
export { E2EEManager, E2EEOptions, FrameCryptor, KeyProvider, KeyProviderOptions } from './e2ee.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AA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B,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACnF,OAAO,EACL,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { AudioFrame, combineAudioFrames } from "./audio_frame.js";
|
|
|
2
2
|
import { AudioResampler, AudioResamplerQuality } from "./audio_resampler.js";
|
|
3
3
|
import { AudioSource } from "./audio_source.js";
|
|
4
4
|
import { AudioStream } from "./audio_stream.js";
|
|
5
|
+
import { AudioFilter } from "./audio_filter.js";
|
|
5
6
|
export * from "./data_streams/index.js";
|
|
6
7
|
import { E2EEManager, FrameCryptor, KeyProvider } from "./e2ee.js";
|
|
7
8
|
import { dispose } from "./ffi_client.js";
|
|
@@ -37,6 +38,7 @@ import { VideoFrame } from "./video_frame.js";
|
|
|
37
38
|
import { VideoSource } from "./video_source.js";
|
|
38
39
|
import { VideoStream } from "./video_stream.js";
|
|
39
40
|
export {
|
|
41
|
+
AudioFilter,
|
|
40
42
|
AudioFrame,
|
|
41
43
|
AudioResampler,
|
|
42
44
|
AudioResamplerQuality,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { AudioSource } from './audio_source.js';\nexport { AudioStream } from './audio_stream.js';\nexport * from './data_streams/index.js';\nexport { E2EEManager, FrameCryptor, KeyProvider } from './e2ee.js';\nexport type { E2EEOptions, KeyProviderOptions } from './e2ee.js';\nexport { dispose } from './ffi_client.js';\nexport { LocalParticipant, Participant, RemoteParticipant } from './participant.js';\nexport { EncryptionState, EncryptionType } from './proto/e2ee_pb.js';\nexport { DisconnectReason, ParticipantKind } from './proto/participant_pb.js';\nexport {\n ConnectionQuality,\n ConnectionState,\n ContinualGatheringPolicy,\n DataPacketKind,\n IceServer,\n IceTransportType,\n TrackPublishOptions,\n} from './proto/room_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoCodec, VideoRotation } from './proto/video_frame_pb.js';\nexport { ConnectError, Room, RoomEvent, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { RpcError, type PerformRpcParams, type RpcInvocationData } from './rpc.js';\nexport {\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n Track,\n type AudioTrack,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n} from './track.js';\nexport {\n LocalTrackPublication,\n RemoteTrackPublication,\n TrackPublication,\n} from './track_publication.js';\nexport type { Transcription, TranscriptionSegment } from './transcription.js';\nexport type { ChatMessage } from './types.js';\nexport { VideoFrame } from './video_frame.js';\nexport { VideoSource } from './video_source.js';\nexport { VideoStream, type VideoFrameEvent } from './video_stream.js';\n"],"mappings":"AAIA,SAAS,YAAY,0BAA0B;AAC/C,SAAS,gBAAgB,6BAA6B;AACtD,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,cAAc;AACd,SAAS,aAAa,cAAc,mBAAmB;AAEvD,SAAS,eAAe;AACxB,SAAS,kBAAkB,aAAa,yBAAyB;AACjE,SAAS,iBAAiB,sBAAsB;AAChD,SAAS,kBAAkB,uBAAuB;AAClD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,WAAW,mBAAmB;AACpD,SAAS,iBAAiB,YAAY,qBAAqB;AAC3D,SAAS,cAAc,MAAM,iBAA0D;AACvF,SAAS,gBAA+D;AACxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,mBAAyC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { AudioSource } from './audio_source.js';\nexport { AudioStream } from './audio_stream.js';\nexport type { NoiseCancellationOptions } from './audio_stream.js';\nexport { AudioFilter } from './audio_filter.js';\nexport * from './data_streams/index.js';\nexport { E2EEManager, FrameCryptor, KeyProvider } from './e2ee.js';\nexport type { E2EEOptions, KeyProviderOptions } from './e2ee.js';\nexport { dispose } from './ffi_client.js';\nexport { LocalParticipant, Participant, RemoteParticipant } from './participant.js';\nexport { EncryptionState, EncryptionType } from './proto/e2ee_pb.js';\nexport { DisconnectReason, ParticipantKind } from './proto/participant_pb.js';\nexport {\n ConnectionQuality,\n ConnectionState,\n ContinualGatheringPolicy,\n DataPacketKind,\n IceServer,\n IceTransportType,\n TrackPublishOptions,\n} from './proto/room_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoCodec, VideoRotation } from './proto/video_frame_pb.js';\nexport { ConnectError, Room, RoomEvent, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { RpcError, type PerformRpcParams, type RpcInvocationData } from './rpc.js';\nexport {\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n Track,\n type AudioTrack,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n} from './track.js';\nexport {\n LocalTrackPublication,\n RemoteTrackPublication,\n TrackPublication,\n} from './track_publication.js';\nexport type { Transcription, TranscriptionSegment } from './transcription.js';\nexport type { ChatMessage } from './types.js';\nexport { VideoFrame } from './video_frame.js';\nexport { VideoSource } from './video_source.js';\nexport { VideoStream, type VideoFrameEvent } from './video_stream.js';\n"],"mappings":"AAIA,SAAS,YAAY,0BAA0B;AAC/C,SAAS,gBAAgB,6BAA6B;AACtD,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAE5B,SAAS,mBAAmB;AAC5B,cAAc;AACd,SAAS,aAAa,cAAc,mBAAmB;AAEvD,SAAS,eAAe;AACxB,SAAS,kBAAkB,aAAa,yBAAyB;AACjE,SAAS,iBAAiB,sBAAsB;AAChD,SAAS,kBAAkB,uBAAuB;AAClD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,WAAW,mBAAmB;AACpD,SAAS,iBAAiB,YAAY,qBAAqB;AAC3D,SAAS,cAAc,MAAM,iBAA0D;AACvF,SAAS,gBAA+D;AACxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,mBAAyC;","names":[]}
|