snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s
This commit is contained in:
126
packages/mp3-encoder/src/lame/Presets.ts
Normal file
126
packages/mp3-encoder/src/lame/Presets.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import { ABRPresets } from './ABRPresets';
|
||||
import type { LameGlobalFlags } from './LameGlobalFlags';
|
||||
import type { Quality } from './Quality';
|
||||
import { VBRPresets } from './VBRPresets';
|
||||
import { VbrMode } from './VbrMode';
|
||||
|
||||
const enum Preset {
|
||||
V9 = 410,
|
||||
V8 = 420,
|
||||
V7 = 430,
|
||||
V6 = 440,
|
||||
V5 = 450,
|
||||
V4 = 460,
|
||||
V3 = 470,
|
||||
V2 = 480,
|
||||
V1 = 490,
|
||||
V0 = 500,
|
||||
R3MIX = 1000,
|
||||
STANDARD = 1001,
|
||||
EXTREME = 1002,
|
||||
INSANE = 1003,
|
||||
STANDARD_FAST = 1004,
|
||||
EXTREME_FAST = 1005,
|
||||
MEDIUM = 1006,
|
||||
MEDIUM_FAST = 1007,
|
||||
}
|
||||
|
||||
export class Presets {
|
||||
private readonly vbrPresets = new VBRPresets();
|
||||
|
||||
public readonly abrPresets = new ABRPresets();
|
||||
|
||||
apply(gfp: LameGlobalFlags, preset: Preset) {
|
||||
switch (preset) {
|
||||
case Preset.R3MIX: {
|
||||
preset = Preset.V3;
|
||||
gfp.VBR = VbrMode.vbr_mtrh;
|
||||
break;
|
||||
}
|
||||
case Preset.MEDIUM: {
|
||||
preset = Preset.V4;
|
||||
gfp.VBR = VbrMode.vbr_rh;
|
||||
break;
|
||||
}
|
||||
case Preset.MEDIUM_FAST: {
|
||||
preset = Preset.V4;
|
||||
gfp.VBR = VbrMode.vbr_mtrh;
|
||||
break;
|
||||
}
|
||||
case Preset.STANDARD: {
|
||||
preset = Preset.V2;
|
||||
gfp.VBR = VbrMode.vbr_rh;
|
||||
break;
|
||||
}
|
||||
case Preset.STANDARD_FAST: {
|
||||
preset = Preset.V2;
|
||||
gfp.VBR = VbrMode.vbr_mtrh;
|
||||
break;
|
||||
}
|
||||
case Preset.EXTREME: {
|
||||
preset = Preset.V0;
|
||||
gfp.VBR = VbrMode.vbr_rh;
|
||||
break;
|
||||
}
|
||||
case Preset.EXTREME_FAST: {
|
||||
preset = Preset.V0;
|
||||
gfp.VBR = VbrMode.vbr_mtrh;
|
||||
break;
|
||||
}
|
||||
case Preset.INSANE: {
|
||||
gfp.preset = 320;
|
||||
gfp.VBR = VbrMode.vbr_off;
|
||||
this.abrPresets.apply(gfp, 320);
|
||||
return 320;
|
||||
}
|
||||
}
|
||||
|
||||
gfp.preset = preset;
|
||||
|
||||
switch (preset) {
|
||||
case Preset.V9:
|
||||
this.vbrPresets.apply(gfp, 9);
|
||||
return preset;
|
||||
case Preset.V8:
|
||||
this.vbrPresets.apply(gfp, 8);
|
||||
return preset;
|
||||
case Preset.V7:
|
||||
this.vbrPresets.apply(gfp, 7);
|
||||
return preset;
|
||||
case Preset.V6:
|
||||
this.vbrPresets.apply(gfp, 6);
|
||||
return preset;
|
||||
case Preset.V5:
|
||||
this.vbrPresets.apply(gfp, 5);
|
||||
return preset;
|
||||
case Preset.V4:
|
||||
this.vbrPresets.apply(gfp, 4);
|
||||
return preset;
|
||||
case Preset.V3:
|
||||
this.vbrPresets.apply(gfp, 3);
|
||||
return preset;
|
||||
case Preset.V2:
|
||||
this.vbrPresets.apply(gfp, 2);
|
||||
return preset;
|
||||
case Preset.V1:
|
||||
this.vbrPresets.apply(gfp, 1);
|
||||
return preset;
|
||||
case Preset.V0:
|
||||
this.vbrPresets.apply(gfp, 0);
|
||||
return preset;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (preset >= 8 && preset <= 320) {
|
||||
return this.abrPresets.apply(gfp, preset);
|
||||
}
|
||||
|
||||
gfp.preset = 0;
|
||||
return preset;
|
||||
}
|
||||
|
||||
applyPresetFromQuality(gfp: LameGlobalFlags, quality: Quality) {
|
||||
return this.apply(gfp, 500 - 10 * quality);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user