mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
Add volume normalization, DSP filters (speed, pitch, bassboost), and playlist pagination (#16, #9, #17)
- Implement EBU R128 dynamic volume normalization & ReplayGain leveling in src/music/audio/VolumeNormalizer.mjs and commands/normalize.mjs (#16) - Add real-time audio filter hot-reloading in PlaybackMixin.mjs and FluxerAudioBridge.mjs (#9) - Add commands for %bassboost (low/medium/hard), %speed (0.5x-2.0x), and %pitch (0.5x-2.0x) (#9) - Implement non-blocking background queue ingestion with progressive progress updates for large Spotify & SoundCloud playlists in SearchMixin.mjs (#17) - Configure playlistLoadLimit: 10 in docker/nodelink.config.json (#17) - Update README documentation and commands table (total 43 commands)
This commit is contained in:
1 parent
90a53f047f
commit
351336ea19
13 files changed
+621
-23
No files matched your search
@@ -18,6 +18,7 @@ import { logger } from "../../core/Logger.mjs";
|
||||
import { get247ChannelMode, detachPlayerFromManager } from "../../utils/Helpers247.mjs";
|
||||
import { hasHumansInChannel } from "../../voice/VoiceStateResolver.mjs";
|
||||
import { FluxerAudioBridge } from "../audio/FluxerAudioBridge.mjs";
|
||||
import { getEffectiveVolume } from "../audio/VolumeNormalizer.mjs";
|
||||
import { applyMixins } from "../../utils/mixins.mjs";
|
||||
import { Queue } from "./Queue.mjs";
|
||||
import PlaybackMixin from "./PlaybackMixin.mjs";
|
||||
@@ -889,6 +890,18 @@ class Player extends EventEmitter {
|
||||
return `:track_next: Skipped to position ${position}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the effective playback volume percentage (0-200), applying dynamic
|
||||
* volume normalization (ReplayGain / EBU R128) if enabled.
|
||||
* @param {object|null} [track=null]
|
||||
* @returns {number} Effective volume percentage (0-200).
|
||||
*/
|
||||
getEffectiveVolume(track = null) {
|
||||
const cur = track || this.queue?.getCurrent?.();
|
||||
const isNorm = this.volumeNormalization !== false;
|
||||
return getEffectiveVolume(this.preferredVolume, cur, isNorm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the playback volume.
|
||||
* @param {number} v - Volume as a decimal (0–2, where 1 = 100%).
|
||||
@@ -898,7 +911,9 @@ class Player extends EventEmitter {
|
||||
this.preferredVolume = Utils.clamp(v, 0, 2);
|
||||
this.emit("volume", this.preferredVolume);
|
||||
if (this._voiceConn) {
|
||||
this._voiceConn.setVolume(this.preferredVolume * 100);
|
||||
try {
|
||||
this._voiceConn.setVolume(this.getEffectiveVolume());
|
||||
} catch (_) {}
|
||||
}
|
||||
if (!this._voiceConn)
|
||||
return `Volume set to \`${Math.round(this.preferredVolume * 100)}%\` — will apply when connected.`;
|
||||
|
||||
Reference in new issue
Block a user