@sv443-network/userutils 2.0.0 → 2.0.1
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/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/dist/index.global.js +4 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lib/dom.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -490,7 +490,7 @@ This is the processing workflow applied to the media element:
|
|
|
490
490
|
|
|
491
491
|
A limiter (compression) is applied to the audio to prevent clipping.
|
|
492
492
|
Its properties can be changed by calling the returned function `setLimiterOptions()`
|
|
493
|
-
The default
|
|
493
|
+
The limiter options set by default are `{ threshold: -12, knee: 30, ratio: 12, attack: 0.003, release: 0.25 }`
|
|
494
494
|
|
|
495
495
|
⚠️ This function has to be run in response to a user interaction event, else the browser will reject it because of the strict autoplay policy.
|
|
496
496
|
⚠️ Make sure to call the returned function `enable()` after calling this function to actually enable the amplification.
|
|
@@ -502,7 +502,7 @@ The returned object of the type `AmplifyMediaResult` has the following propertie
|
|
|
502
502
|
| `getGain()` | Returns the current gain multiplier |
|
|
503
503
|
| `enable()` | Call to enable the amplification for the first time or if it was disabled before |
|
|
504
504
|
| `disable()` | Call to disable amplification |
|
|
505
|
-
| `setLimiterOptions()` | Used for changing the [options of the DynamicsCompressorNode](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode/DynamicsCompressorNode#options) - the default is `{ threshold: -
|
|
505
|
+
| `setLimiterOptions()` | Used for changing the [options of the DynamicsCompressorNode](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode/DynamicsCompressorNode#options) - the default is `{ threshold: -12, knee: 30, ratio: 12, attack: 0.003, release: 0.25 }` |
|
|
506
506
|
| `context` | The AudioContext instance |
|
|
507
507
|
| `source` | The MediaElementSourceNode instance |
|
|
508
508
|
| `gainNode` | The GainNode instance used for actually boosting the gain |
|
package/dist/index.global.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// ==UserLibrary==
|
|
10
10
|
// @name UserUtils
|
|
11
11
|
// @description Library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, manage persistent user configurations, modify the DOM more easily and more
|
|
12
|
-
// @version 2.0.
|
|
12
|
+
// @version 2.0.1
|
|
13
13
|
// @license MIT
|
|
14
14
|
// @copyright Sv443 (https://github.com/Sv443)
|
|
15
15
|
|
|
@@ -341,7 +341,7 @@ var UserUtils = (function (exports) {
|
|
|
341
341
|
},
|
|
342
342
|
/**
|
|
343
343
|
* Set the options of the [limiter / DynamicsCompressorNode](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode/DynamicsCompressorNode#options)
|
|
344
|
-
* The default is `{ threshold: -
|
|
344
|
+
* The default is `{ threshold: -12, knee: 30, ratio: 12, attack: 0.003, release: 0.25 }`
|
|
345
345
|
*/
|
|
346
346
|
setLimiterOptions(options) {
|
|
347
347
|
for (const [key, val] of Object.entries(options))
|
|
@@ -353,8 +353,8 @@ var UserUtils = (function (exports) {
|
|
|
353
353
|
limiterNode: context.createDynamicsCompressor()
|
|
354
354
|
};
|
|
355
355
|
props.setLimiterOptions({
|
|
356
|
-
threshold: -
|
|
357
|
-
knee:
|
|
356
|
+
threshold: -12,
|
|
357
|
+
knee: 30,
|
|
358
358
|
ratio: 12,
|
|
359
359
|
attack: 3e-3,
|
|
360
360
|
release: 0.25
|
package/dist/index.js
CHANGED
|
@@ -320,7 +320,7 @@ function amplifyMedia(mediaElement, initialMultiplier = 1) {
|
|
|
320
320
|
},
|
|
321
321
|
/**
|
|
322
322
|
* Set the options of the [limiter / DynamicsCompressorNode](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode/DynamicsCompressorNode#options)
|
|
323
|
-
* The default is `{ threshold: -
|
|
323
|
+
* The default is `{ threshold: -12, knee: 30, ratio: 12, attack: 0.003, release: 0.25 }`
|
|
324
324
|
*/
|
|
325
325
|
setLimiterOptions(options) {
|
|
326
326
|
for (const [key, val] of Object.entries(options))
|
|
@@ -332,8 +332,8 @@ function amplifyMedia(mediaElement, initialMultiplier = 1) {
|
|
|
332
332
|
limiterNode: context.createDynamicsCompressor()
|
|
333
333
|
};
|
|
334
334
|
props.setLimiterOptions({
|
|
335
|
-
threshold: -
|
|
336
|
-
knee:
|
|
335
|
+
threshold: -12,
|
|
336
|
+
knee: 30,
|
|
337
337
|
ratio: 12,
|
|
338
338
|
attack: 3e-3,
|
|
339
339
|
release: 0.25
|
package/dist/index.mjs
CHANGED
|
@@ -318,7 +318,7 @@ function amplifyMedia(mediaElement, initialMultiplier = 1) {
|
|
|
318
318
|
},
|
|
319
319
|
/**
|
|
320
320
|
* Set the options of the [limiter / DynamicsCompressorNode](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode/DynamicsCompressorNode#options)
|
|
321
|
-
* The default is `{ threshold: -
|
|
321
|
+
* The default is `{ threshold: -12, knee: 30, ratio: 12, attack: 0.003, release: 0.25 }`
|
|
322
322
|
*/
|
|
323
323
|
setLimiterOptions(options) {
|
|
324
324
|
for (const [key, val] of Object.entries(options))
|
|
@@ -330,8 +330,8 @@ function amplifyMedia(mediaElement, initialMultiplier = 1) {
|
|
|
330
330
|
limiterNode: context.createDynamicsCompressor()
|
|
331
331
|
};
|
|
332
332
|
props.setLimiterOptions({
|
|
333
|
-
threshold: -
|
|
334
|
-
knee:
|
|
333
|
+
threshold: -12,
|
|
334
|
+
knee: 30,
|
|
335
335
|
ratio: 12,
|
|
336
336
|
attack: 3e-3,
|
|
337
337
|
release: 0.25
|
package/dist/lib/dom.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export declare function amplifyMedia<TElem extends HTMLMediaElement>(mediaElemen
|
|
|
80
80
|
disable(): void;
|
|
81
81
|
/**
|
|
82
82
|
* Set the options of the [limiter / DynamicsCompressorNode](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode/DynamicsCompressorNode#options)
|
|
83
|
-
* The default is `{ threshold: -
|
|
83
|
+
* The default is `{ threshold: -12, knee: 30, ratio: 12, attack: 0.003, release: 0.25 }`
|
|
84
84
|
*/
|
|
85
85
|
setLimiterOptions(options: Partial<Record<"threshold" | "knee" | "ratio" | "attack" | "release", number>>): void;
|
|
86
86
|
context: AudioContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sv443-network/userutils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Library with various utilities for userscripts - register listeners for when CSS selectors exist, intercept events, manage persistent user configurations, modify the DOM more easily and more",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|