VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.
Python aiaudiobookcudadubbingelevenlabs-alternativehuggingfacelocal-firstmlxomnivoice-studiospeech-to-texttext-to-speechtranscriptiontranslatettsvoice-aivoice-cloningvoice-generationvoicestudioworkflow
fix(audio): limit take fix to playback source
velixio6c0a53b8b5bf
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2a0dba7c5..a180e7457 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -19,7 +19,7 @@ metadata and the backend fallback mirror it.### Fixed-- Recent synthesized takes remain visible and playable, with permanent History exposed in Voice Design (#3102)+- Older synthesized takes play again after a newer generation takes over audio playback (#3102)- Generated speech no longer starts and ends with silence, and `[pause]` markers give exactly the pause you asked for (Raw preset and explicit durations untouched) (#3080)- Engine sidecars no longer load PyTorch just to answer the Test Engine ping, and a failed test logs its reason locally (#3026) — thanks @tekay-de!diff --git a/electron/src/renderer/src/components/app-shell/workspace-header.test.tsx b/electron/src/renderer/src/components/app-shell/workspace-header.test.tsxdeleted file mode 100644index 8c9e4e0cf..000000000--- a/electron/src/renderer/src/components/app-shell/workspace-header.test.tsx+++ /dev/null@@ -1,25 +0,0 @@-import { cleanup, fireEvent, render, screen } from '@testing-library/react';-import { afterEach, expect, it, vi } from 'vitest';--vi.mock('react-i18next', () => ({- useTranslation: () => ({ t: (key: string) => key }),-}));-vi.mock('@/components/bridge', () => ({ isMac: () => true }));-vi.mock('./support-shortcut', () => ({ SupportShortcut: () => null }));--import { WorkspaceHeader } from './workspace-header';--afterEach(cleanup);--it('renders page actions with the shared header controls', () => {- const openHistory = vi.fn();-- render(- <WorkspaceHeader actions={<button onClick={openHistory}>History</button>}>- <h1>Voice Design</h1>- </WorkspaceHeader>,- );-- fireEvent.click(screen.getByRole('button', { name: 'History' }));- expect(openHistory).toHaveBeenCalledOnce();-});diff --git a/electron/src/renderer/src/components/app-shell/workspace-header.tsx b/electron/src/renderer/src/components/app-shell/workspace-header.tsxindex f9114931d..757d43f2c 100644--- a/electron/src/renderer/src/components/app-shell/workspace-header.tsx+++ b/electron/src/renderer/src/components/app-shell/workspace-header.tsx@@ -7,13 +7,7 @@ import { Button } from '@/components/ui/button';import { cn } from '@/lib/utils';import { isMac } from '@/components/bridge';-export function WorkspaceHeader({- children,- actions,-}: {- children: ReactNode;- actions?: ReactNode;-}) {+export function WorkspaceHeader({ children }: { children: ReactNode }) {const { t } = useTranslation();return (<header@@ -25,7 +19,6 @@ export function WorkspaceHeader({{!isMac() && <SidebarToggle />}{children}<div className="ml-auto flex shrink-0 items-center gap-1">- {actions}<SupportShortcut /><Buttonvariant="ghost"diff --git a/electron/src/renderer/src/features/clone/output-panel.test.tsx b/electron/src/renderer/src/features/clone/output-panel.test.tsxindex 2fef97230..f3470a3cd 100644--- a/electron/src/renderer/src/features/clone/output-panel.test.tsx+++ b/electron/src/renderer/src/features/clone/output-panel.test.tsx@@ -41,22 +41,16 @@ function result(audioPath: string | null): GenerateResult {}it('plays a completed take from its persistent audio path instead of a revocable blob URL', () => {- const older = result('take-0.wav');- const latest = result('take-1.wav');mocks.output.mockReturnValue({- result: latest,+ result: result('take-1.wav'),objectUrl: 'blob:http://localhost/revoked',text: 'Hello',- takes: [- { result: latest, objectUrl: 'blob:http://localhost/latest', text: 'Hello' },- { result: older, objectUrl: 'blob:http://localhost/older', text: 'Earlier' },- ],});render(<OutputPanel />);- expect(screen.getAllByTestId('player').map((player) => player.dataset.src)).toEqual([+ expect(screen.getByTestId('player')).toHaveAttribute(+ 'data-src','/api/audio/take-1.wav',- '/api/audio/take-0.wav',- ]);+ );});diff --git a/electron/src/renderer/src/features/clone/output-panel.tsx b/electron/src/renderer/src/features/clone/output-panel.tsxindex b9b043a03..be7e99029 100644--- a/electron/src/renderer/src/features/clone/output-panel.tsx+++ b/electron/src/renderer/src/features/clone/output-panel.tsx@@ -13,10 +13,11 @@ import { SectionLabel } from './section-label';export function OutputPanel() {const { t } = useTranslation();- const { result, objectUrl, text, takes } = useLatestOutput();+ const { result, objectUrl, text } = useLatestOutput();if (!result || !objectUrl) return null;const stamp = new Date().toISOString().slice(0, 19).replace(/[:T]/g, '-');+ const playbackUrl = result.audioPath ? audioUrl(result.audioPath) : objectUrl;return (<section@@ -40,7 +41,7 @@ export function OutputPanel() {aria-label={t('common.close')}title={t('common.close')}onClick={() => {- if (activePlaybackSource()?.startsWith('output')) stopActivePlayback();+ if (activePlaybackSource() === 'output') stopActivePlayback();clearLatestOutput();}}>@@ -50,23 +51,9 @@ export function OutputPanel() {</div>{result && objectUrl ? (<>- <div className="flex max-h-64 flex-col gap-2 overflow-y-auto pr-1">- {takes.map((take, index) => {- const playbackUrl = take.result.audioPath- ? audioUrl(take.result.audioPath)- : take.objectUrl;- return playbackUrl ? (- <WaveformPlayer- key={take.result.id ?? take.result.audioPath ?? take.objectUrl ?? index}- src={playbackUrl}- source={index === 0 ? 'output' : `output-${take.result.id ?? index}`}- height={36}- />- ) : null;- })}- </div>+ <WaveformPlayer key={objectUrl} src={playbackUrl} source="output" height={36} /><AudioFileDetails blob={result.blob} />- {result.audioPath && <AudioQuality audioPath={result.audioPath} />}+ {result.audioPath && <AudioQuality key={objectUrl} audioPath={result.audioPath} />}<div className="flex flex-wrap items-start justify-between gap-3"><pclassName="line-clamp-2 min-w-40 flex-1 text-sm text-muted-foreground"diff --git a/electron/src/renderer/src/features/design/design-page.tsx b/electron/src/renderer/src/features/design/design-page.tsxindex 3bad4c0c8..c80360faa 100644--- a/electron/src/renderer/src/features/design/design-page.tsx+++ b/electron/src/renderer/src/features/design/design-page.tsx@@ -59,7 +59,6 @@ import { EngineLanguagePicker } from '@/features/clone/engine-language-picker';import { queryKeys } from '@/lib/query';import { cn } from '@/lib/utils';import { cloneSettingsStore } from '@/lib/store/clone-settings';-import { setWorkspace } from '@/lib/store/workspace';import type { Profile } from '@/lib/api/types';import { CATEGORIES, PRESETS } from '@shared/utils/constants';import { buildDesignInstruct, mergeDescribedAttrs } from '@shared/utils/voiceInstruct';@@ -171,18 +170,7 @@ export function DesignPage() {.join(' · ') || t('clone.identity_auto');return (<div className="flex h-full min-h-0 flex-col">- <WorkspaceHeader- actions={- <Button- variant="ghost"- size="sm"- onClick={() => setWorkspace({ libraryOpen: true, libraryTab: 'takes' })}- >- <HistoryIcon data-icon="inline-start" />- {t('clone.history_title')}- </Button>- }- >+ <WorkspaceHeader><h1 className="text-sm font-medium">{t('designWorkspace.title')}</h1></WorkspaceHeader><div className="flex min-h-0 flex-1 @max-[40rem]:flex-col">diff --git a/electron/src/renderer/src/lib/store/output.test.ts b/electron/src/renderer/src/lib/store/output.test.tsdeleted file mode 100644index 9cd839d13..000000000--- a/electron/src/renderer/src/lib/store/output.test.ts+++ /dev/null@@ -1,39 +0,0 @@-import { beforeEach, expect, it, vi } from 'vitest';-import type { GenerateResult } from '@/lib/api/types';-import { clearLatestOutput, outputStore, setLatestOutput } from './output';--const createObjectURL = vi.fn(() => `blob:take-${createObjectURL.mock.calls.length}`);-const revokeObjectURL = vi.fn();--function result(id: string): GenerateResult {- return {- blob: new Blob([id], { type: 'audio/wav' }),- id,- audioPath: `${id}.wav`,- durationSeconds: 1,- genTimeSeconds: 2,- seed: 3,- routing: null,- dropped: null,- };-}--beforeEach(() => {- Object.assign(URL, { createObjectURL, revokeObjectURL });- clearLatestOutput();- createObjectURL.mockClear();- revokeObjectURL.mockClear();-});--it('retains earlier session takes until the output history is cleared', () => {- setLatestOutput(result('first'), 'First');- const firstUrl = outputStore.state.objectUrl;- setLatestOutput(result('second'), 'Second');-- expect(outputStore.state.takes.map((take) => take.result.id)).toEqual(['second', 'first']);- expect(revokeObjectURL).not.toHaveBeenCalledWith(firstUrl);-- clearLatestOutput();- expect(revokeObjectURL).toHaveBeenCalledWith(firstUrl);- expect(outputStore.state.takes).toEqual([]);-});diff --git a/electron/src/renderer/src/lib/store/output.ts b/electron/src/renderer/src/lib/store/output.tsindex d76a18d26..2078d4893 100644--- a/electron/src/renderer/src/lib/store/output.ts+++ b/electron/src/renderer/src/lib/store/output.ts@@ -9,39 +9,20 @@ export interface OutputState {objectUrl: string | null;/** The script that produced `result`. */text: string;- /** Recent takes from this synthesis session, newest first. */- takes: OutputTake[];}-export interface OutputTake {- result: GenerateResult;- objectUrl: string | null;- text: string;-}--const MAX_SESSION_TAKES = 10;--export const outputStore = new Store<OutputState>({- result: null,- objectUrl: null,- text: '',- takes: [],-});+export const outputStore = new Store<OutputState>({ result: null, objectUrl: null, text: '' });export function useLatestOutput(): OutputState {return useStore(outputStore);}export function setLatestOutput(result: GenerateResult, text: string): void {- const take = { result, objectUrl: createObjectUrl(result.blob), text };- outputStore.setState((state) => {- const takes = [take, ...state.takes];- for (const dropped of takes.slice(MAX_SESSION_TAKES)) revokeObjectUrl(dropped.objectUrl);- return { ...take, takes: takes.slice(0, MAX_SESSION_TAKES) };- });+ revokeObjectUrl(outputStore.state.objectUrl);+ outputStore.setState(() => ({ result, objectUrl: createObjectUrl(result.blob), text }));}export function clearLatestOutput(): void {- for (const take of outputStore.state.takes) revokeObjectUrl(take.objectUrl);- outputStore.setState(() => ({ result: null, objectUrl: null, text: '', takes: [] }));+ revokeObjectUrl(outputStore.state.objectUrl);+ outputStore.setState(() => ({ result: null, objectUrl: null, text: '' }));}