feat(editor): add AI multilingual voice translation, zero-shot voice cloning (Fish Audio S2-Pro), and synced dubbing tab
Summary
Introduce a dedicated AI Voice Translation & Dubbing tab in the editor's left sidebar. This feature allows users to translate their screen recording's spoken audio into a target language, synthesize the new audio using zero-shot voice cloning trained on a sample of their real voice (utilizing fishaudio/s2-pro), replace/toggle the original microphone track on the timeline, and automatically generate time-aligned translated captions.
UI Placement
As shown in the editor interface, add a new action icon on the left vertical tool rail below the current presets/cloud icon:
- Icon: Speech / Translate icon (e.g.,
LanguagesorAudioWaveformfrom Lucide icons). - Panel Header:
VOICE TRANSLATION & DUBBING - Trigger: Clicking opens the configuration drawer matching the existing
BACKGROUND,FRAME, andCAPTIONSpanel styling.
User Workflow
[1. Transcribe Audio] ──► [2. Select Language] ──► [3. Provide Voice Sample]
│
[6. Sync Captions] ◄── [5. Replace Audio] ◄── [4. Generate S2-Pro Audio]
- Prerequisite / Transcription:
- The user clicks Transcribe / Fetch Captions (or the tab automatically hooks into the existing recording transcript generated from the microphone channel).
- Target Language Selection:
- A dropdown menu to select the destination language (e.g., English $\leftrightarrow$ Bengali, Spanish, French, German, Japanese, etc.).
- Voice Reference Input:
- A dedicated upload/recording area where the user provides a short audio sample (5–10 seconds) of their natural voice.
- Alternative: A "Use Recording Microphone Audio" quick button to extract a clean vocal slice directly from the active timeline track as the voice reference.
- Voice Cloning & Synthesis:
- The pipeline translates the transcript segments and runs zero-shot acoustic synthesis using Fish Audio S2-Pro (
fishaudio/s2-pro), preserving the creator's natural timbre, pitch, cadence, and vocal character.
- The pipeline translates the transcript segments and runs zero-shot acoustic synthesis using Fish Audio S2-Pro (
- Timeline Track Replacement / Toggling:
- The synthesized voice is placed directly onto the audio timeline.
- Provides a toggle switch to Mute / Replace Original Mic Track or Swap Audio, allowing the user to seamlessly switch between the original speaker voice and the newly dubbed translated track without losing original media files.
- Synchronized Translated Captions:
- Generates a matching target-language subtitle track.
- Automatically calculates word/sentence boundaries based on the synthesized audio duration and places the translated caption overlays at the exact timestamps on the timeline.
Technical Implementation Details
1. Audio Processing & Project Schema
- Update the
.recordlyproject data structure to support secondary voiceover tracks:
interface DubbingTrack {
id: string;
targetLanguage: string;
sourceAudioRef: string;
dubbedAudioPath: string;
referenceVoiceSamplePath?: string;
isActive: boolean;
syncedCaptions: Array<{
start: number; // in seconds
end: number;
text: string;
}>;
}
- Ensure playback engine synchronizes the active dubbed audio track with video playback, muting the primary
mic.wavstream when active.
2. Inference & Model Pipeline
- Translation Engine: Model-agnostic connector (e.g., IndicTrans2 for South Asian pairs, NLLB-200 / local translation worker).
- Voice Cloning & TTS Engine: Integration layer for
fishaudio/s2-pro(via local Python sidecar service or modular API endpoint) accepting: prompt_audio: Reference voice sample.text: Translated transcript segments.language: Target language code.
3. Subtitle Alignment
- Utilize the phoneme/word-level timestamps emitted during S2-Pro generation to dynamically update the subtitle region nodes on the PixiJS timeline canvas.
Acceptance Criteria
- [ ] New navigation icon rendered on the left sidebar beneath the existing tool list.
- [ ] Drawer UI containing step-by-step inputs: Transcribe $\rightarrow$ Target Language $\rightarrow$ Voice Sample $\rightarrow$ Generate.
- [ ] Users can upload a custom
.wav/.mp3voice sample or sample directly from their project microphone audio. - [ ] Synthesis runs via
fishaudio/s2-proworker and produces high-fidelity cloned speech in the target language. - [ ] Timeline can toggle between the original microphone audio and the translated voiceover.
- [ ] Captions automatically update and align with the translated audio timing when the dubbed track is selected.
- [ ] Project save/export correctly renders the selected dubbed audio and translated subtitles into the final MP4 output.
Suggested labels: enhancement, feature, audio
I work on AceDataCloud's Fish Audio API. This issue's Fish S2-Pro choice is one place where we can provide a concrete integration fixture, with two important contract details:
- Our one-shot voice reference is a public HTTPS audio URL plus the exact transcript of that reference clip; the endpoint does not accept raw file bytes/base64/data URLs. If the user selects a 5–10s mic slice, Recordly would need to transcribe and upload that authorized slice first, or use a saved
reference_idfor repeated use. POST /fish/ttsselectss2-proin themodelrequest header and returns anaudio_url(or a task ID in async mode). It does not return word-level alignment in the documented response, so caption timing should come from a separate alignment/transcription step rather than inferred from the TTS call.
For an editor E2E, I'd test clip consent/ownership, translated segment → audio URL, download/cache, segment alignment, timeline mute/toggle, save/reopen, and final MP4 export. A task ID or audio URL alone is not proof the dubbed track and captions are synchronized. Docs: https://platform.acedata.cloud/service/fish. Disclosure: AceDataCloud affiliation; this is an optional hosted path, not a claim that the local sidecar has already been integrated.