[!WARNING] this project was written with ai based on a proof of concept python file
CodecMerger is a web-based tool that allows users to merge multiple audio files directly in their browser. It aims to provide a simple drag-and-drop interface for combining audio tracks, leveraging client-side processing for speed and privacy. The core audio processing logic for aligning, mixing, and normalizing audio is inspired by concepts from a Python proof-of-concept.
The application is built with Svelte and Vite, using ffmpeg.wasm
for all in-browser audio manipulation tasks. bun
is used as the JavaScript runtime, bundler, and package manager.
ffmpeg.wasm
to support a wide range of audio codecs and containers.ffmpeg.wasm
: Option to toggle multi-threaded ffmpeg.wasm
execution.ffmpeg.wasm
(@ffmpeg/ffmpeg
, @ffmpeg/core
or @ffmpeg/core-mt
, @ffmpeg/util
)+page.svelte
)Clone the repository:
git clone https://github.com/your-username/your-repo-name.git # <-- Update this URL
cd your-repo-name
Install dependencies using Bun:
bun install
To start the development server:
bun run dev
This will typically open the application in your web browser at http://localhost:5173
.
To create a production build of the application:
bun run build
The output files will be generated in the build
directory. This command is also used by the deployment script.
To preview the production build locally (after running bun run build
):
bun run preview
This project is configured for automated deployment to GitHub Pages using a GitHub Actions workflow (.github/workflows/deploy.yml
).
How it works:
main
branch (or your configured default branch), the GitHub Action will:svelte.config.js
and vite.config.ts
with the correct repository name for the base
path (using the GITHUB_REPOSITORY
variable).@sveltejs/adapter-static
).Repository Configuration for GitHub Pages:
Base Path Configuration:
The svelte.config.js
and vite.config.ts
files are configured to set the correct base
path for GitHub Pages deployment. The workflow automatically updates a placeholder REPLACE_WITH_YOUR_REPO_NAME
with your actual repository name. If you manually changed this placeholder to your repository name, the script will still run but won't find the placeholder to replace, which is fine.
Example (svelte.config.js
):
paths: {
base: process.env.NODE_ENV === 'production' ? '/your-repo-name' : '',
}
Example (vite.config.ts
):
const repoName = 'your-repo-name';
// ...
base: mode === 'production' ? `/${repoName}/` : '/',
ffmpeg.wasm
and Cross-Origin Isolationffmpeg.wasm
can utilize SharedArrayBuffer
for multi-threaded performance (@ffmpeg/core-mt
).SharedArrayBuffer
requires specific HTTP headers for cross-origin isolation:Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
vite.config.ts
includes these headers for the local development server.ffmpeg.wasm
might not work as expected or at all when deployed to GitHub Pages.This project exclusively uses bun
as its JavaScript runtime, bundler, and package manager.
npm
, npx
, yarn
, or any other package managers.bun
(e.g., bun install
, bun run dev
).bun.lockb
.This README was generated with assistance from an AI pair programmer.