xsound 3.2.1 → 3.3.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.
- package/README.md +2 -49
- package/build/types/AudioModule/AudioModuleProcessor.d.ts +2 -0
- package/build/types/AudioModule/AudioModuleProcessor.d.ts.map +1 -1
- package/build/types/AudioModule/index.d.ts +0 -2
- package/build/types/AudioModule/index.d.ts.map +1 -1
- package/build/types/MediaModule/MediaModuleProcessor.d.ts +2 -0
- package/build/types/MediaModule/MediaModuleProcessor.d.ts.map +1 -1
- package/build/types/MediaModule/index.d.ts +0 -2
- package/build/types/MediaModule/index.d.ts.map +1 -1
- package/build/types/MixerModule/MixerModuleProcessor.d.ts +2 -0
- package/build/types/MixerModule/MixerModuleProcessor.d.ts.map +1 -1
- package/build/types/MixerModule/index.d.ts +0 -2
- package/build/types/MixerModule/index.d.ts.map +1 -1
- package/build/types/NoiseModule/NoiseModuleProcessor.d.ts +2 -0
- package/build/types/NoiseModule/NoiseModuleProcessor.d.ts.map +1 -1
- package/build/types/NoiseModule/index.d.ts +0 -2
- package/build/types/NoiseModule/index.d.ts.map +1 -1
- package/build/types/OneshotModule/OneshotModuleProcessor.d.ts +2 -0
- package/build/types/OneshotModule/OneshotModuleProcessor.d.ts.map +1 -1
- package/build/types/OneshotModule/index.d.ts +0 -2
- package/build/types/OneshotModule/index.d.ts.map +1 -1
- package/build/types/OscillatorModule/OscillatorModuleProcessor.d.ts +2 -0
- package/build/types/OscillatorModule/OscillatorModuleProcessor.d.ts.map +1 -1
- package/build/types/OscillatorModule/index.d.ts +0 -2
- package/build/types/OscillatorModule/index.d.ts.map +1 -1
- package/build/types/ProcessorModule/index.d.ts +0 -2
- package/build/types/ProcessorModule/index.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/NoiseGateProcessor.d.ts +2 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/NoiseGateProcessor.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/NoiseSuppressorProcessor.d.ts +2 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/NoiseSuppressorProcessor.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/PitchShifterProcessor.d.ts +2 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/PitchShifterProcessor.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/StereoProcessor.d.ts +2 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/StereoProcessor.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/VocalCancelerProcessor.d.ts +2 -1
- package/build/types/SoundModule/Effectors/AudioWorkletProcessors/VocalCancelerProcessor.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/NoiseGate.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/NoiseSuppressor.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/PitchShifter.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/Stereo.d.ts.map +1 -1
- package/build/types/SoundModule/Effectors/VocalCanceler.d.ts.map +1 -1
- package/build/types/SoundModule/Recorder/RecorderProcessor.d.ts +16 -0
- package/build/types/SoundModule/Recorder/RecorderProcessor.d.ts.map +1 -0
- package/build/types/SoundModule/Recorder/index.d.ts +7 -8
- package/build/types/SoundModule/Recorder/index.d.ts.map +1 -1
- package/build/types/SoundModule/SoundModuleProcessor.d.ts +3 -0
- package/build/types/SoundModule/SoundModuleProcessor.d.ts.map +1 -1
- package/build/types/SoundModule/index.d.ts +2 -4
- package/build/types/SoundModule/index.d.ts.map +1 -1
- package/build/types/StreamModule/StreamModuleProcessor.d.ts +2 -0
- package/build/types/StreamModule/StreamModuleProcessor.d.ts.map +1 -1
- package/build/types/StreamModule/index.d.ts +0 -2
- package/build/types/StreamModule/index.d.ts.map +1 -1
- package/build/types/main.d.ts +2 -4
- package/build/types/main.d.ts.map +1 -1
- package/build/types/types.d.ts +0 -1
- package/build/types/types.d.ts.map +1 -1
- package/build/xsound.js +1 -1
- package/build/xsound.js.LICENSE.txt +1 -1
- package/build/xsound.js.map +1 -1
- package/build/xsound.min.js +1 -1
- package/build/xsound.min.js.LICENSE.txt +1 -1
- package/build/xsound.min.js.map +1 -1
- package/package.json +17 -17
- package/build/types/SoundModule/Session/Room.d.ts +0 -63
- package/build/types/SoundModule/Session/Room.d.ts.map +0 -1
- package/build/types/SoundModule/Session/index.d.ts +0 -107
- package/build/types/SoundModule/Session/index.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xsound",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"engines": {
|
|
5
|
-
"node": ">=
|
|
5
|
+
"node": ">=16.0.0 <=18.16.x"
|
|
6
6
|
},
|
|
7
7
|
"description": "XSound gives Web Developers Powerful Audio Features Easily !",
|
|
8
8
|
"main": "build/xsound.js",
|
|
@@ -65,29 +65,29 @@
|
|
|
65
65
|
"README.md"
|
|
66
66
|
],
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@types/jest": "^29.5.
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
70
|
-
"@typescript-eslint/parser": "^
|
|
68
|
+
"@types/jest": "^29.5.3",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
70
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
71
71
|
"cross-env": "^7.0.3",
|
|
72
72
|
"dotenv-webpack": "^8.0.1",
|
|
73
|
-
"eslint": "^8.
|
|
73
|
+
"eslint": "^8.45.0",
|
|
74
74
|
"eslint-cli": "^1.1.1",
|
|
75
|
-
"eslint-config-standard": "^17.
|
|
75
|
+
"eslint-config-standard": "^17.1.0",
|
|
76
76
|
"eslint-plugin-import": "^2.27.5",
|
|
77
|
-
"eslint-plugin-n": "^
|
|
77
|
+
"eslint-plugin-n": "^16.0.1",
|
|
78
78
|
"eslint-plugin-node": "^11.1.0",
|
|
79
79
|
"eslint-plugin-promise": "^6.1.1",
|
|
80
80
|
"husky": "4.3.8",
|
|
81
|
-
"jest": "^29.
|
|
82
|
-
"jest-environment-jsdom": "^29.
|
|
83
|
-
"lint-staged": "^13.2.
|
|
81
|
+
"jest": "^29.6.1",
|
|
82
|
+
"jest-environment-jsdom": "^29.6.1",
|
|
83
|
+
"lint-staged": "^13.2.3",
|
|
84
84
|
"terser-webpack-plugin": "^5.3.9",
|
|
85
|
-
"ts-jest": "^29.1.
|
|
86
|
-
"ts-loader": "^9.4.
|
|
87
|
-
"typedoc": "^0.24.
|
|
85
|
+
"ts-jest": "^29.1.1",
|
|
86
|
+
"ts-loader": "^9.4.4",
|
|
87
|
+
"typedoc": "^0.24.8",
|
|
88
88
|
"typescript": "^4.7.4",
|
|
89
|
-
"webpack": "^5.
|
|
90
|
-
"webpack-cli": "^5.1.
|
|
91
|
-
"webpack-dev-server": "^4.15.
|
|
89
|
+
"webpack": "^5.88.1",
|
|
90
|
+
"webpack-cli": "^5.1.4",
|
|
91
|
+
"webpack-dev-server": "^4.15.1"
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Connectable } from '../../interfaces';
|
|
2
|
-
import { SessionSetupParams, SessionConnectionParams } from './';
|
|
3
|
-
export declare type RoomMap = {
|
|
4
|
-
[id: string]: WebSocket | null;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* This class is entity for room feature in session.
|
|
8
|
-
* @constructor
|
|
9
|
-
*/
|
|
10
|
-
export declare class Room implements Connectable {
|
|
11
|
-
private static BUFFER_SIZE;
|
|
12
|
-
private id;
|
|
13
|
-
private context;
|
|
14
|
-
private analyser;
|
|
15
|
-
private sender;
|
|
16
|
-
private receiver;
|
|
17
|
-
private websocket;
|
|
18
|
-
/**
|
|
19
|
-
* @param {AudioContext} context This argument is in order to use interfaces of Web Audio API.
|
|
20
|
-
* @param {SessionSetupParams} params This argument is in order to create instance of `Room`.
|
|
21
|
-
*/
|
|
22
|
-
constructor(context: AudioContext, params: SessionSetupParams);
|
|
23
|
-
/**
|
|
24
|
-
* This method creates instance of `WebSocket` and registers event handlers. Namely, join room.
|
|
25
|
-
* @param {SessionConnectionParams} params This argument is in order to create instance of `WebSocket`.
|
|
26
|
-
*/
|
|
27
|
-
join(params: SessionConnectionParams): void;
|
|
28
|
-
/**
|
|
29
|
-
* This method sends sound Room ID and data (as `Float32Array`) to server.
|
|
30
|
-
*/
|
|
31
|
-
send(): void;
|
|
32
|
-
/**
|
|
33
|
-
* This method stops sending and receiving data by disconnecting `AudioNode`.
|
|
34
|
-
* Namely, leave room temporarily.
|
|
35
|
-
*/
|
|
36
|
-
leave(): void;
|
|
37
|
-
/**
|
|
38
|
-
* This method closes connection to WebSocket server and destroys instance of `WebSocket`.
|
|
39
|
-
* Namely, leave room permanently.
|
|
40
|
-
*/
|
|
41
|
-
clear(): void;
|
|
42
|
-
/**
|
|
43
|
-
* This method connects `AudioNode`s for receiving data.
|
|
44
|
-
*/
|
|
45
|
-
connect(): void;
|
|
46
|
-
/**
|
|
47
|
-
* This method determines whether there is connection to server.
|
|
48
|
-
* @return {boolean} If connection to server exists, this value is `true`. Otherwise, this value is `false`.
|
|
49
|
-
*/
|
|
50
|
-
connected(): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* This method gets instance of `WebSocket` that corresponds Room ID.
|
|
53
|
-
* @return {RoomMap}
|
|
54
|
-
*/
|
|
55
|
-
get(): RoomMap;
|
|
56
|
-
/** @override */
|
|
57
|
-
get INPUT(): ScriptProcessorNode;
|
|
58
|
-
/** @override */
|
|
59
|
-
get OUTPUT(): ScriptProcessorNode;
|
|
60
|
-
/** @override */
|
|
61
|
-
toString(): string;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=Room.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Room.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Session/Room.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,IAAI,CAAC;AAEjE,oBAAY,OAAO,GAAG;IACpB,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;CAC/B,CAAC;AAEF;;;GAGG;AACH,qBAAa,IAAK,YAAW,WAAW;IAEtC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAQ;IAElC,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,QAAQ,CAAW;IAE3B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,QAAQ,CAAsB;IAEtC,OAAO,CAAC,SAAS,CAA0B;IAE3C;;;OAGG;gBACS,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB;IAY7D;;;OAGG;IACI,IAAI,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAsElD;;OAEG;IACI,IAAI,IAAI,IAAI;IA+BnB;;;OAGG;IACI,KAAK,IAAI,IAAI;IASpB;;;OAGG;IACI,KAAK,IAAI,IAAI;IAWpB;;OAEG;IACI,OAAO,IAAI,IAAI;IAQtB;;;OAGG;IACI,SAAS,IAAI,OAAO;IAI3B;;;OAGG;IACI,GAAG,IAAI,OAAO;IAIrB,gBAAgB;IAChB,IAAW,KAAK,IAAI,mBAAmB,CAEtC;IAED,gBAAgB;IAChB,IAAW,MAAM,IAAI,mBAAmB,CAEvC;IAED,gBAAgB;IACT,QAAQ,IAAI,MAAM;CAG1B"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { Connectable } from '../../interfaces';
|
|
2
|
-
import { BufferSize } from '../../types';
|
|
3
|
-
import { Analyser } from '../Analyser';
|
|
4
|
-
import { Room, RoomMap } from './Room';
|
|
5
|
-
export declare type NumberOfSessionChannels = 1 | 2;
|
|
6
|
-
export type { Room, RoomMap };
|
|
7
|
-
/**
|
|
8
|
-
* @property {string} roomId This property is string that identifies messaging room.
|
|
9
|
-
* @property {BufferSize} bufferSize This property is buffer size for `ScriptProcessorNode`.
|
|
10
|
-
* @property {NumberOfSessionChannels} numberOfInputs This property is the number of inputs for `ScriptProcessorNode`.
|
|
11
|
-
* @property {NumberOfSessionChannels} numberOfOutputs This property the number of outputs for `ScriptProcessorNode`.
|
|
12
|
-
* @property {Analyser} analyser This property is instance of `Analyser`.
|
|
13
|
-
*/
|
|
14
|
-
export declare type SessionSetupParams = {
|
|
15
|
-
roomId: string;
|
|
16
|
-
bufferSize: BufferSize;
|
|
17
|
-
numberOfInputs: NumberOfSessionChannels;
|
|
18
|
-
numberOfOutputs: NumberOfSessionChannels;
|
|
19
|
-
analyser: Analyser;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* @property {string} roomId This property is string that identifies messaging room.
|
|
23
|
-
* @property {boolean} tls This property is in order to select protocol (either `wss` or `ws`).
|
|
24
|
-
* @property {string} host This property is server's hostname.
|
|
25
|
-
* @property {number} port This property is port number for connection.
|
|
26
|
-
* @property {string} path This property is script path that is executed in server side.
|
|
27
|
-
* @property {function} openCallback This property is invoked as `onopen` event handler in instance of `WebSocket`.
|
|
28
|
-
* @property {function} closeCallback This property is invoked as `onclose` event handler in instance of `WebSocket`.
|
|
29
|
-
* @property {function} errorCallback This property is invoked as `onerror` event handler in instance of `WebSocket`.
|
|
30
|
-
*/
|
|
31
|
-
export declare type SessionConnectionParams = {
|
|
32
|
-
roomId: string;
|
|
33
|
-
tls: boolean;
|
|
34
|
-
host: string;
|
|
35
|
-
port: number;
|
|
36
|
-
path: string;
|
|
37
|
-
openCallback?(event: Event): void;
|
|
38
|
-
closeCallback?(event: Event): void;
|
|
39
|
-
errorCallback?(event: Event): void;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* This private class manages sound session rooms.
|
|
43
|
-
* @constructor
|
|
44
|
-
*/
|
|
45
|
-
export declare class Session implements Connectable {
|
|
46
|
-
private context;
|
|
47
|
-
private input;
|
|
48
|
-
private output;
|
|
49
|
-
private rooms;
|
|
50
|
-
/**
|
|
51
|
-
* @param {AudioContext} context This argument is in order to use Web Audio API.
|
|
52
|
-
*/
|
|
53
|
-
constructor(context: AudioContext);
|
|
54
|
-
/**
|
|
55
|
-
* This method creates instance of `Room`.
|
|
56
|
-
* @param {SessionSetupParams} params This argument is in order to create instance of `Room`.
|
|
57
|
-
* @return {Session} Return value is for method chain.
|
|
58
|
-
*/
|
|
59
|
-
setup(params: SessionSetupParams): Session;
|
|
60
|
-
/**
|
|
61
|
-
* This method creates instance of `WebSocket`.
|
|
62
|
-
* @param {SessionConnectionParams} params This argument is in order to create instance of `WebSocket`.
|
|
63
|
-
* @return {Session} Return value is for method chain.
|
|
64
|
-
*/
|
|
65
|
-
ready(params: SessionConnectionParams): Session;
|
|
66
|
-
/**
|
|
67
|
-
* This method sends sound data to server.
|
|
68
|
-
* @param {string} roomId This argument is string that identifies messaging room.
|
|
69
|
-
* @return {Session} Return value is for method chain.
|
|
70
|
-
*/
|
|
71
|
-
start(roomId: string): Session;
|
|
72
|
-
/**
|
|
73
|
-
* This method stops sending and receiving data.
|
|
74
|
-
* @param {string} roomId This argument is string that identifies messaging room.
|
|
75
|
-
* @return {Session} Return value is for method chain.
|
|
76
|
-
*/
|
|
77
|
-
stop(roomId: string): Session;
|
|
78
|
-
/**
|
|
79
|
-
* This method closes connection to WebSocket server and destroys instance of `WebSocket`.
|
|
80
|
-
* @param {string} roomId This argument is string that identifies messaging room.
|
|
81
|
-
* @return {Session} Return value is for method chain.
|
|
82
|
-
*/
|
|
83
|
-
clear(roomId: string): Session;
|
|
84
|
-
/**
|
|
85
|
-
* This method connects `AudioNode`s.
|
|
86
|
-
* @param {string} roomId This argument is string that identifies messaging room.
|
|
87
|
-
* @return {Session} Return value is for method chain.
|
|
88
|
-
*/
|
|
89
|
-
connect(roomId: string): Session;
|
|
90
|
-
/**
|
|
91
|
-
* This method determines whether there is connection to server.
|
|
92
|
-
* @param {string} roomId This argument is string that identifies messaging room.
|
|
93
|
-
* @return {boolean}
|
|
94
|
-
*/
|
|
95
|
-
connected(roomId: string): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* This method gets instance of `Room` that is designated Room ID.
|
|
98
|
-
* @param {string} roomId This argument is string that identifies room.
|
|
99
|
-
* @return {Room}
|
|
100
|
-
*/
|
|
101
|
-
get(roomId: string): Room | null;
|
|
102
|
-
/** @override */
|
|
103
|
-
get INPUT(): GainNode;
|
|
104
|
-
/** @override */
|
|
105
|
-
get OUTPUT(): GainNode;
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SoundModule/Session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEvC,oBAAY,uBAAuB,GAAG,CAAC,GAAG,CAAC,CAAC;AAE5C,YAAY,EACV,IAAI,EACJ,OAAO,EACR,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,uBAAuB,CAAC;IACxC,eAAe,EAAE,uBAAuB,CAAC;IACzC,QAAQ,EAAE,QAAQ,CAAA;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,oBAAY,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAClC,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACnC,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACnC,CAAC;AAEF;;;GAGG;AACH,qBAAa,OAAQ,YAAW,WAAW;IACzC,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,KAAK,CAAc;IAE3B;;OAEG;gBACS,OAAO,EAAE,YAAY;IAOjC;;;;OAIG;IACI,KAAK,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO;IAKjD;;;;OAIG;IACI,KAAK,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO;IAYtD;;;;OAIG;IACI,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAcrC;;;;OAIG;IACI,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAYpC;;;;OAIG;IACI,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAYrC;;;;OAIG;IACI,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAavC;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAUzC;;;;OAIG;IACI,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIvC,gBAAgB;IAChB,IAAW,KAAK,IAAI,QAAQ,CAE3B;IAED,gBAAgB;IAChB,IAAW,MAAM,IAAI,QAAQ,CAE5B;CACF"}
|