npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

audio-to-srt

v0.2.0

Published

🎙Convert audio to subtitle by volcengine service

Downloads

40

Readme

audio-to-srt

npm publish

🎙通过火山引擎服务将本地或在线音频文件转换为 SRT 字幕文件。

安装

pnpm add audio-to-srt -g

用法

  1. 首先去官网搜索语音技术,创建应用选择音视频字幕生成,第一次开通有 20 小时的免费试用包。
  2. 左侧导航进入音视频字幕生成,记住自己的 appidtoken
  3. 可以将 appidtoken 配置到环境变量,ATS_APPIDATS_TOKEN,就不用每次都通过命令行传入了。
  4. 准备好音频文件,程序通过文件后缀名判断类型,所以请规范文件命名。使用 ffmpeg 或者格式工厂转换很方便。
    # 以 wav 格式为例:将视频转为 wav
    ffmpeg -i 1.mp4 -f wav -vn -acodec pcm_s16le -ar 16000 -ac 1 1.wav

使用本地音频文件:

ats -a your_appid -t your_token -l en-US -f your.wav

正在提交任务...
提交成功,当前任务编号: xxxxxx-xxxx-xxxx-xxxx-xxxxxx
正在查询结果,请耐心等待...
转换完成,已生成字幕文件: your.srt

使用在线音频文件:

ats -a your_appid -t your_token -l en-US -u http://xxx.com/your.wav

生成的字幕文件会保存在执行命令的当前目录。

查看帮助信息:

ats --help

Usage: ats [options]

Options:
  -a, --appid <value>            应用标识 (env: ATS_APPID)
  -t, --token <value>            鉴权 Token (env: ATS_TOKEN)
  -l, --language <code>          字幕语言类型 (default: "zh-CN")
  -w, --words_per_line <number>  每行最多展示字数 (default: 46)
  -m, --max_lines <number>       每屏最多展示行数 (default: 1)
  -c, --caption_type <type>      字幕识别类型 (choices: "auto", "speech", "singing", default: "speech")
  -f, --file <path>              音频文件路径
  -u, --url <link>               音频链接
  --use_itn                      使用数字转换功能
  --no-use_punc                  不增加标点
  --no-use_ddc                   不使用顺滑标注水词
  --with_speaker_info            返回说话人信息
  -v, --version                  打印版本号
  -h, --help                     打印帮助信息

Supported languages:
  +--------------+---------------+----------------+
  | 语言         | Language Code | 分句长度推荐值 |
  +--------------+---------------+----------------+
  | 中文普通话   | zh-CN         | 15             |
  | 英语(美国) | en-US         | 55             |
  | 日语         | ja-JP         | 32             |
  | 韩语         | ko-KR         | 32             |
  | 粤语         | yue           | 15             |
  | 上海话       | wuu           | 15             |
  | 闽南语       | nan           | 15             |
  | 西南官话     | xghu          | 15             |
  | 中原官话     | zgyu          | 15             |
  | 维语         | ug            | 55             |
  | 西班牙语     | es-MX         | 55             |
  | 俄语         | ru-RU         | 55             |
  | 法语         | fr-FR         | 55             |
  +--------------+---------------+----------------+

更多信息请查看官网文档:https://www.volcengine.com/docs/6561/80909