transcriptmaster / prompts /subtitle.js
bigbossmonster's picture
Upload 9 files
cbca414 verified
export const SUBTITLE_PROMPT = (script) => `
Task: Generate a professional SRT (SubRip Subtitle) file by perfectly aligning the provided script with the audio input.
STRICT TECHNICAL RULES (VIOLATION WILL CAUSE SYNC ERROR):
1. MANDATORY TIMESTAMP FORMAT:
- Each segment MUST use exactly "HH:MM:SS,mmm" (e.g., 00:01:05,250 --> 00:01:08,100).
- NEVER omit the hour digits. For a 2-minute video, it MUST be 00:02:..., NOT 02:...
- Example: 1 minute 5 seconds is 00:01:05,000.
2. PRECISION ALIGNMENT (AUDIO-VISUAL SYNC):
- START TIME: Must mark the exact millisecond the speaker begins the first word of the segment.
- END TIME: Must mark the exact millisecond the speaker finishes the last word of the segment.
- AVOID EARLY ENTRY/EXIT: Subtitles must not appear before the sound starts or remain after the sound ends.
3. SILENCE & GAP HANDLING:
- If there is a gap/silence between sentences (e.g., background music or no talking), DO NOT span a single subtitle block over that silence.
- End the current block when talking stops. Start the next block ONLY when talking resumes.
- Ensure you skip non-verbal parts correctly to maintain long-term synchronization.
4. BATCH INTEGRITY:
- Do not let the subtitles drift. If the speaker talks faster or slower later in the video, adjust the timestamps to match the actual wave activity, not just a fixed duration.
5. TEXT ACCURACY:
- Use the provided script exactly: "${script}".
- Break text into readable chunks (max 7-10 words per segment) matching natural speech pauses.
6. PURE OUTPUT:
- Return ONLY the raw SRT content. No labels like "SRT:", no markdown headers, and no AI commentary.
`;