{"id":42406399,"url":"https://github.com/justorez/audio-to-srt","last_synced_at":"2026-01-28T01:38:18.169Z","repository":{"id":210229861,"uuid":"726060457","full_name":"justorez/audio-to-srt","owner":"justorez","description":"🎙通过火山引擎服务将本地或在线音频文件转换为 SRT 字幕文件","archived":false,"fork":false,"pushed_at":"2025-03-07T16:57:29.000Z","size":29,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T20:25:06.806Z","etag":null,"topics":["audio","audio-to-srt","cli","subtitle"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justorez.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-01T13:00:40.000Z","updated_at":"2025-11-17T06:18:49.000Z","dependencies_parsed_at":"2024-01-18T14:31:24.187Z","dependency_job_id":"e3fe547c-9aeb-44fe-8ea4-664e7bd1ada0","html_url":"https://github.com/justorez/audio-to-srt","commit_stats":null,"previous_names":["justorez/audio2srt"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/justorez/audio-to-srt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justorez%2Faudio-to-srt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justorez%2Faudio-to-srt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justorez%2Faudio-to-srt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justorez%2Faudio-to-srt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justorez","download_url":"https://codeload.github.com/justorez/audio-to-srt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justorez%2Faudio-to-srt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-to-srt","cli","subtitle"],"created_at":"2026-01-28T01:38:18.111Z","updated_at":"2026-01-28T01:38:18.155Z","avatar_url":"https://github.com/justorez.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# audio-to-srt\r\n\r\n[![npm](https://badgen.net/npm/v/audio-to-srt)](https://www.npmjs.com/package/audio-to-srt)\r\n[![publish](https://github.com/justorez/audio-to-srt/actions/workflows/publish.yml/badge.svg)](https://github.com/justorez/audio-to-srt/actions/workflows/publish.yml)\r\n\r\n🎙通过[火山引擎](https://www.volcengine.com/)服务将本地或在线音频文件转换为 SRT 字幕文件。\r\n\r\n## 安装\r\n\r\n```bash\r\npnpm add audio-to-srt -g\r\n```\r\n\r\n## 用法\r\n\r\n1. 首先去[官网](https://console.volcengine.com/speech/app)搜索`语音技术`，创建应用选择`音视频字幕生成`，第一次开通有 20 小时的免费试用包。\r\n2. 左侧导航进入`音视频字幕生成`，记住自己的 `appid` 和 `token`。\r\n3. 可以将 `appid` 和 `token` 配置到环境变量，`ATS_APPID` 和 `ATS_TOKEN`，就不用每次都通过命令行传入了。\r\n4. 准备好音频文件，程序通过文件后缀名判断类型，所以请规范文件命名。使用 `ffmpeg` 或者格式工厂转换很方便。\r\n    ```bash\r\n    # 以 wav 格式为例：将视频转为 wav\r\n    ffmpeg -i 1.mp4 -f wav -vn -acodec pcm_s16le -ar 16000 -ac 1 1.wav\r\n    ```\r\n\r\n使用本地音频文件：\r\n\r\n```bash\r\nats -a your_appid -t your_token -l en-US -f your.wav\r\n\r\n正在提交任务...\r\n提交成功，当前任务编号: xxxxxx-xxxx-xxxx-xxxx-xxxxxx\r\n正在查询结果，请耐心等待...\r\n转换完成，已生成字幕文件: your.srt\r\n```\r\n\r\n使用在线音频文件：\r\n\r\n```bash\r\nats -a your_appid -t your_token -l en-US -u http://xxx.com/your.wav\r\n```\r\n\r\n生成的字幕文件会保存在执行命令的当前目录。\r\n\r\n查看帮助信息：\r\n\r\n```bash\r\nats --help\r\n\r\nUsage: ats [options]\r\n\r\nOptions:\r\n  -a, --appid \u003cvalue\u003e            应用标识 (env: ATS_APPID)\r\n  -t, --token \u003cvalue\u003e            鉴权 Token (env: ATS_TOKEN)\r\n  -l, --language \u003ccode\u003e          字幕语言类型 (default: \"zh-CN\")\r\n  -w, --words_per_line \u003cnumber\u003e  每行最多展示字数 (default: 46)\r\n  -m, --max_lines \u003cnumber\u003e       每屏最多展示行数 (default: 1)\r\n  -c, --caption_type \u003ctype\u003e      字幕识别类型 (choices: \"auto\", \"speech\", \"singing\", default: \"speech\")\r\n  -f, --file \u003cpath\u003e              音频文件路径\r\n  -u, --url \u003clink\u003e               音频链接\r\n  --use_itn                      使用数字转换功能\r\n  --no-use_punc                  不增加标点\r\n  --no-use_ddc                   不使用顺滑标注水词\r\n  --with_speaker_info            返回说话人信息\r\n  -v, --version                  打印版本号\r\n  -h, --help                     打印帮助信息\r\n\r\nSupported languages:\r\n  +--------------+---------------+----------------+\r\n  | 语言         | Language Code | 分句长度推荐值 |\r\n  +--------------+---------------+----------------+\r\n  | 中文普通话   | zh-CN         | 15             |\r\n  | 英语（美国） | en-US         | 55             |\r\n  | 日语         | ja-JP         | 32             |\r\n  | 韩语         | ko-KR         | 32             |\r\n  | 粤语         | yue           | 15             |\r\n  | 上海话       | wuu           | 15             |\r\n  | 闽南语       | nan           | 15             |\r\n  | 西南官话     | xghu          | 15             |\r\n  | 中原官话     | zgyu          | 15             |\r\n  | 维语         | ug            | 55             |\r\n  | 西班牙语     | es-MX         | 55             |\r\n  | 俄语         | ru-RU         | 55             |\r\n  | 法语         | fr-FR         | 55             |\r\n  +--------------+---------------+----------------+\r\n\r\n更多信息请查看官网文档：https://www.volcengine.com/docs/6561/80909\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustorez%2Faudio-to-srt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustorez%2Faudio-to-srt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustorez%2Faudio-to-srt/lists"}