mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
fix: Added Normalizer as filter, fixed bug with bassboost filter enabling normalizing filter not working properly
This commit is contained in:
1 parent
b236371abc
commit
21b15a10a0
2 files changed
+18
-8
No files matched your search
@@ -132,14 +132,18 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
|
||||
let filtersToEnable = confirmation.values;
|
||||
// if bassboost is enabled, also enable normalizer to avoid distrorion
|
||||
if (confirmation.values.includes('bassboost_low') || confirmation.values.includes('bassboost')) {
|
||||
filtersToEnable.push('normalizer');
|
||||
let filtersEnabledByUser = [...confirmation.values];
|
||||
|
||||
// if bassboost is enabled and not normalizer, also enable normalizer to avoid distrorion
|
||||
if (
|
||||
(confirmation.values.includes('bassboost_low') || confirmation.values.includes('bassboost')) &&
|
||||
!confirmation.values.includes('normalizer')
|
||||
) {
|
||||
confirmation.values.push('normalizer');
|
||||
}
|
||||
|
||||
// Enable provided filters
|
||||
queue.filters.ffmpeg.toggle(filtersToEnable);
|
||||
queue.filters.ffmpeg.toggle(confirmation.values);
|
||||
|
||||
logger.debug(
|
||||
`[Shard ${interaction.guild.shardId}] Enabled filters ${confirmation.values.join(', ')} for command ${
|
||||
@@ -157,12 +161,12 @@ module.exports = {
|
||||
.setDescription(
|
||||
`**${
|
||||
embedOptions.icons.success
|
||||
} Filters toggled**\nNow using these filters:\n${confirmation.values
|
||||
} Filters toggled**\nNow using these filters:\n${filtersEnabledByUser
|
||||
.map(
|
||||
(enabled) =>
|
||||
(enabledFilter) =>
|
||||
`\`${
|
||||
ffmpegFilterOptions.availableFilters.find(
|
||||
(filter) => enabled == filter.value
|
||||
(filter) => enabledFilter == filter.value
|
||||
).label
|
||||
}\``
|
||||
)
|
||||
|
||||
@@ -175,6 +175,12 @@ module.exports.ffmpegFilterOptions = {
|
||||
value: 'treble',
|
||||
description: 'Increase the high frequencies.',
|
||||
emoji: '🎼'
|
||||
},
|
||||
{
|
||||
label: 'Normalizer',
|
||||
value: 'normalizer',
|
||||
description: 'Normalize the audio (avoid distortion).',
|
||||
emoji: '🎶'
|
||||
}
|
||||
]
|
||||
};
|
||||
Reference in new issue
Block a user