Skip to content

Split any YouTube song into stems

TypeScript

Export full track with stems; cleanup player header

Daniel Ravinaf3026a2aa918
diff --git a/package-lock.json b/package-lock.json
index 04b9fd4..92beb7d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "stemkit",
- "version": "0.1.7",
+ "version": "0.1.13",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "stemkit",
- "version": "0.1.7",
+ "version": "0.1.13",
"dependencies": {
"electron-updater": "^6.8.9"
},
diff --git a/package.json b/package.json
index 8c76d8f..cc60112 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "stemkit",
"productName": "StemKit",
- "version": "0.1.12",
+ "version": "0.1.13",
"description": "Local YouTube stem splitter and player",
"main": "./out/main/index.js",
"author": "daniel",
diff --git a/src/main/index.ts b/src/main/index.ts
index 3ecd6fa..9af49cb 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -10,7 +10,7 @@ import {
refreshReady,
getStatus
} from './env'
-import { loadSongs, removeSong, stemBuffers, stemsDir, stemsFor } from './library'
+import { loadSongs, removeSong, stemBuffers, stemsDir, stemsFor, mixWavPath } from './library'
import { startJob, cancelJob, searchYouTube } from './pipeline'
import { initUpdater } from './updater'
@@ -161,7 +161,13 @@ app.whenReady().then(async () => {
for (const name of list) {
copyFileSync(join(dir, `${name}.wav`), join(target, `${name}.wav`))
}
- return { saved: true, path: target, count: list.length }
+ let count = list.length
+ const mix = mixWavPath(videoId)
+ if (existsSync(mix)) {
+ copyFileSync(mix, join(target, `${sanitizeName(song?.title ?? 'full track')}.wav`))
+ count += 1
+ }
+ return { saved: true, path: target, count }
})
ipcMain.handle('search:youtube', (_e, query: string) => searchYouTube(query))
diff --git a/src/renderer/src/components/Player.tsx b/src/renderer/src/components/Player.tsx
index c5a0071..b60fec1 100644
--- a/src/renderer/src/components/Player.tsx
+++ b/src/renderer/src/components/Player.tsx
@@ -288,10 +288,7 @@ export function Player({ song }: Props): React.ReactElement {
return (
<div className="h-full flex flex-col">
<header className="drag-region h-14 shrink-0 flex items-center justify-between px-6">
- <h2 className="text-sm font-semibold truncate max-w-md">{song.title}</h2>
- <span className="text-[11px] text-white/30 font-medium tracking-wide uppercase">
- {ytReady && !decoding ? 'synced to youtube · local stems' : ''}
- </span>
+ <h2 className="text-sm font-semibold truncate">{song.title}</h2>
</header>
<div className="flex-1 min-h-0 overflow-y-auto px-6 pb-6">
@@ -352,7 +349,7 @@ export function Player({ song }: Props): React.ReactElement {
className="no-drag glass rounded-xl px-5 py-3 text-[13px] font-medium text-white/70 hover:text-white hover:bg-white/10 transition-colors flex items-center gap-2 disabled:opacity-40"
>
<DownloadIcon className="w-4 h-4" />
- Export all stems
+ Export everything
</button>
<button
onClick={() => window.stemkit.openExternal(youtubeUrl)}