Closed piwawa closed 5 months ago
from openlrc.subtitle import Subtitle
if __name__ == '__main__':
lrcer.run("/home/bingo06/AIGC/auto_ai_subtitle/video/output.m4a", src_lang='yue', target_lang='zh-cn', skip_trans=True)
subtitle = Subtitle.from_file('/home/bingo06/AIGC/auto_ai_subtitle/video/output.lrc')
subtitle.to_srt()
You can convert the format yourself. Note that if the audio length is more than one hour, lrcer.run
will automatically output in .srt format.
使用以下代码:
lrcer.run("/home/bingo06/AIGC/auto_ai_subtitle/video/output.m4a", src_lang='yue', target_lang='zh-cn', skip_trans=True)
生成结果为:
希望可以指定用
srt
或是lrc
输出。