cvsa/ml/lab/whisperAlignment/align2srt.py
alikia2x 636c5e25cb
ref: move ML stuff
add: .idea to VCS, the refactor guide
2025-03-29 14:13:15 +08:00

6 lines
256 B
Python

import stable_whisper
def align2srt(lyrics, audio_path, output_path):
model = stable_whisper.load_model('large-v3')
result = model.align(audio_path, lyrics, language="Chinese", regroup=False)
result.to_srt_vtt(output_path, segment_level=False)