V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
MagaFun
V2EX  ›  Python

这个程序是怎样做到自动生成 SRT 文件的?

  •  
  •   MagaFun · Aug 23, 2017 · 3893 views
    This topic created in 3171 days ago, the information mentioned may be changed or developed.

    最近在研究自动字幕,发现了这个程序:agermanidis/autosub

    这款程序可以做到实时生成 SRT 文件,我想问的是这款软件是怎么样做到生成时间轴的? 这块 分析语音的代码我没能看懂,麻烦能简单解释一下吗?提前感谢。

    3 replies    2017-08-23 05:48:36 +08:00
    Geoion
        1
    Geoion  
       Aug 23, 2017
    代码没看完,这块代码大概是切分每句话的长度(帧)
    starvedcat
        2
    starvedcat  
       Aug 23, 2017
    看变量命名( is_silence, energy, threshold ),就是通过音量来判断的吧
    starvedcat
        3
    starvedcat  
       Aug 23, 2017
    看代码里面用到的 audioop.rms 函数的作用,就是在计算每个 chunk 的声音强度
    https://docs.python.org/2/library/audioop.html#audioop.rms
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1244 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:36 · PVG 01:36 · LAX 10:36 · JFK 13:36
    ♥ Do have faith in what you're doing.