Skip to content

Commit

Permalink
Initial commit: Cool AudioM application
Browse files Browse the repository at this point in the history
  • Loading branch information
Cool AudioM Developer committed Nov 21, 2024
0 parents commit 98eefda
Show file tree
Hide file tree
Showing 10 changed files with 5,529 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
dist/
mastered/
.DS_Store
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Cool AudioM

A desktop application for batch audio mastering using reference tracks. Built with Electron.

## Features

- Multiple audio file processing in one go
- Reference track-based mastering
- Easy-to-use interface
- Supports WAV and MP3 formats
- Results saved in high-quality WAV format

## Requirements

- Python with matchering package installed
- Windows operating system

## Installation

Download the latest installer from the Releases section and run `Cool AudioM Setup.exe`.

## Development Setup

1. Clone the repository
2. Install dependencies:
```bash
npm install
```
3. Run the application:
```bash
npm start
```

## Building

To create a Windows installer:
```bash
npm run build
```

## License

ISC
Binary file added build/icon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<title>Cool AudioM</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Cool AudioM</h1>

<div class="file-section">
<div class="file-input">
<h2>Target Track</h2>
<div id="targetTracks">
<div class="target-track">
<button class="selectTarget">Select Target File</button>
<p class="targetPath">No file selected</p>
</div>
</div>
<button id="addTrackButton">+ Add Another Track</button>
</div>

<div class="file-input">
<h2>Reference Track</h2>
<button id="selectReference">Select Reference File</button>
<p id="referencePath">No file selected</p>
</div>
</div>

<div class="process-section">
<button id="processButton" disabled>Process</button>
<div id="progress" class="progress-bar">
<div class="progress-fill"></div>
</div>
<p id="status">Ready</p>
<p id="resultLink" style="display: none;">Result: <a href="#" id="downloadLink">result.wav</a> | <a href="#" id="folderLink">Open Folder</a></p>
</div>
</div>
<script src="renderer.js"></script>
</body>
</html>
76 changes: 76 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
const { app, BrowserWindow, ipcMain, dialog, shell } = require('electron');
const path = require('path');
const { spawn } = require('child_process');

function createWindow() {
const win = new BrowserWindow({
width: 1200,
height: 800,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});

win.loadFile('index.html');
}

app.whenReady().then(() => {
createWindow();

app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
});

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});

ipcMain.handle('select-file', async (event, type) => {
const result = await dialog.showOpenDialog({
properties: ['openFile'],
filters: [
{ name: 'Audio Files', extensions: ['wav', 'mp3'] }
]
});
return result.filePaths[0];
});

ipcMain.handle('process-audio', async (event, { targetFile, referenceFile, outputFile }) => {
return new Promise((resolve, reject) => {
const pythonScript = `
import matchering as mg
import sys
try:
mg.process(
target=sys.argv[1],
reference=sys.argv[2],
results=[
mg.pcm16(sys.argv[3])
]
)
print("success")
except Exception as e:
print(f"error: {str(e)}")
`;
const pythonProcess = spawn('python', ['-c', pythonScript, targetFile, referenceFile, outputFile || 'result.wav']);

pythonProcess.stdout.on('data', (data) => {
const output = data.toString().trim();
resolve(output);
});

pythonProcess.stderr.on('data', (data) => reject(data.toString()));
});
});

ipcMain.handle('open-folder', async (event, folderPath) => {
await shell.openPath(folderPath);
return true;
});
2 changes: 2 additions & 0 deletions matchElect.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo off
npm start
Loading

0 comments on commit 98eefda

Please sign in to comment.