diff --git a/web/i18n/en/settings.json b/web/i18n/en/settings.json index c45c1251..163e806c 100644 --- a/web/i18n/en/settings.json +++ b/web/i18n/en/settings.json @@ -49,15 +49,19 @@ "audio.format.ogg": "ogg", "audio.format.wav": "wav", "audio.format.opus": "opus", - "audio.format.description": "every format but \"best\" is converted, meaning that they're lossy. if preferred format matches best available audio, it won't be converted.", + "audio.format.description": "all formats but \"best\" are converted, meaning that there'll be some quality loss. if preferred format matches best available audio, it won't be converted.", + + "audio.bitrate": "audio bitrate", + "audio.bitrate.kbps": "kb/s", + "audio.bitrate.description": "preferred bitrate to use when converting audio. final perceived quality may differ based on the format.", "audio.youtube.dub": "youtube", "audio.youtube.dub.title": "use browser language for dubbed videos", "audio.youtube.dub.description": "works even if cobalt isn't translated to your language.", "audio.tiktok.original": "tiktok", - "audio.tiktok.original.title": "use original sound", - "audio.tiktok.original.description": "downloads original sound used in the post without any additional changes by the post's author.", + "audio.tiktok.original.title": "download original sound", + "audio.tiktok.original.description": "if enabled, cobalt will download the sound from the post without any changes by the post's author.", "metadata.filename": "filename style", "metadata.filename.classic": "classic", diff --git a/web/src/lib/api/api.ts b/web/src/lib/api/api.ts index 40d7dded..8243c61f 100644 --- a/web/src/lib/api/api.ts +++ b/web/src/lib/api/api.ts @@ -16,6 +16,7 @@ const request = async (url: string) => { downloadMode: saveSettings.downloadMode, + audioBitrate: saveSettings.audioBitrate, audioFormat: saveSettings.audioFormat, tiktokFullAudio: saveSettings.tiktokFullAudio, youtubeDubBrowserLang: saveSettings.youtubeDubBrowserLang, diff --git a/web/src/lib/settings/defaults.ts b/web/src/lib/settings/defaults.ts index eb43e7e1..bf0b11e4 100644 --- a/web/src/lib/settings/defaults.ts +++ b/web/src/lib/settings/defaults.ts @@ -15,6 +15,7 @@ const defaultSettings: CobaltSettings = { reduceTransparency: false, }, save: { + audioBitrate: "256", audioFormat: "mp3", disableMetadata: false, downloadMode: "auto", diff --git a/web/src/lib/types/settings.ts b/web/src/lib/types/settings.ts index 1c47c20f..d52f3d77 100644 --- a/web/src/lib/types/settings.ts +++ b/web/src/lib/types/settings.ts @@ -2,6 +2,7 @@ import languages from '$i18n/languages.json'; import type { RecursivePartial } from './generic'; export const themeOptions = ["auto", "light", "dark"] as const; +export const audioBitrateOptions = ["320", "256", "128", "96", "64"] as const; export const audioFormatOptions = ["best", "mp3", "ogg", "wav", "opus"] as const; export const downloadModeOptions = ["auto", "audio", "mute"] as const; export const filenameStyleOptions = ["classic", "basic", "pretty", "nerdy"] as const; @@ -32,6 +33,7 @@ type CobaltSettingsProcessing = { type CobaltSettingsSave = { audioFormat: typeof audioFormatOptions[number], + audioBitrate: typeof audioBitrateOptions[number], disableMetadata: boolean, downloadMode: typeof downloadModeOptions[number], filenameStyle: typeof filenameStyleOptions[number], diff --git a/web/src/routes/settings/audio/+page.svelte b/web/src/routes/settings/audio/+page.svelte index a780a177..cc14c9e2 100644 --- a/web/src/routes/settings/audio/+page.svelte +++ b/web/src/routes/settings/audio/+page.svelte @@ -1,7 +1,7 @@