{"id":29543921,"url":"https://github.com/widdit/now-playing-service","last_synced_at":"2026-04-02T16:59:27.110Z","repository":{"id":265186339,"uuid":"895392825","full_name":"Widdit/now-playing-service","owner":"Widdit","description":"直播歌曲歌名显示组件。检测各类音乐软件正在播放的歌曲信息以及进度条信息，提供查询 API 接口。适用于 OBS、直播姬等各类直播软件。","archived":false,"fork":false,"pushed_at":"2025-07-09T13:34:48.000Z","size":73109,"stargazers_count":203,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T14:44:50.087Z","etag":null,"topics":["live","music","nowplaying","obs","overlay","song","stream","widget"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Widdit.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-28T05:58:28.000Z","updated_at":"2025-07-09T13:34:53.000Z","dependencies_parsed_at":"2025-04-09T07:21:11.855Z","dependency_job_id":"13b5a02a-14c7-4249-b912-00ce73b3236e","html_url":"https://github.com/Widdit/now-playing-service","commit_stats":null,"previous_names":["widdit/now-playing-service"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Widdit/now-playing-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Widdit%2Fnow-playing-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Widdit%2Fnow-playing-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Widdit%2Fnow-playing-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Widdit%2Fnow-playing-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Widdit","download_url":"https://codeload.github.com/Widdit/now-playing-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Widdit%2Fnow-playing-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265614368,"owners_count":23798430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["live","music","nowplaying","obs","overlay","song","stream","widget"],"created_at":"2025-07-17T14:09:09.969Z","updated_at":"2026-04-02T16:59:27.105Z","avatar_url":"https://github.com/Widdit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![Banner](/images/now_playing_2_banner_3.png)\n\n\u003ch2\u003e一款用于直播/桌面的「正在播放」歌曲信息展示工具\u003c/h2\u003e\n\n此仓库为 Now Playing 后端代码仓库，前端代码请访问：[now-playing-frontend](https://github.com/Widdit/now-playing-frontend)\n\nQQ 交流群：150453391\n\n\u003c/div\u003e\n\n---\n\n## 功能特性\n\n### 核心功能\n\n- 歌曲组件：实时检测并展示正在播放的歌曲信息，包括歌名、作者、封面、时长及播放进度\n- 歌词组件：提供近 40 个配置项，支持全方位自定义；智能匹配最佳歌词，同时获取多种歌词源并采用最佳结果\n- 播放器：仿 Apple Music 风格的播放器页面，展示歌曲信息与滚动歌词；支持电脑、移动设备等多端同步使用\n- 信息输出：系统会生成包含当前歌曲信息的文件，供直播软件读取，支持模板自定义展示歌曲信息\n- API 接口：开发者可利用 Now Playing API 自行设计前端页面，并通过软件内置服务器进行本地部署\n\n### 支持平台\n\n支持 20+ 音乐平台，持续扩充中：\n\n| 类型 | 平台 |\n|:---:|:----------------------------------|\n| 国内平台 | 网易云音乐、ＱＱ音乐、酷狗音乐、酷我音乐、汽水音乐、全民Ｋ歌 |\n| 国外平台 | Spotify、Apple Music、YouTube Music |\n| 点歌机 | 咩播、卡西米尔唱片机、花花直播助手、BQ 点歌姬 |\n| 本地播放器 | PotPlayer、Foobar2000、AIMP |\n| 其它 | 洛雪音乐、MusicFree、Cider、YesPlayMusic |\n\n### 检测能力\n\n- **歌曲信息**：歌名、歌手名、专辑名、歌曲封面、时长\n- **进度条信息**：进度条位置、播放状态（播放/暂停）\n- **识别方式**：支持窗口标题 / SMTC 两种方式\n\n### 兼容性\n\n- 直播软件：适用于 OBS、B 站直播姬、抖音直播伴侣、斗鱼直播伴侣、虎牙直播、视频号直播、小红书直播、Streamlabs 等各类直播软件\n- 操作系统：Windows 10 / 11（64 位）\n\n---\n\n## 界面预览\n\n![](/images/app_preview.png)\n\n---\n\n## 使用方法\n\n### 方法一：下载整合包（推荐）\n\n- 前往 [Release](https://github.com/Widdit/now-playing-service/releases) 页面下载整合包\n- 开箱即用，无需进行任何配置\n\n### 方法二：结合第三方网站\n\n1. 前往 [网站](https://6klabs.com/amuse) 并使用 Google 账号登录（仅登录时需要梯子）\n2. 点击 \"Widgets\" 页面进入组件设置页面\n3. 在 \"Music Service\" 中选择 \"YouTube Music\"，下方样式设置可自由调整\n4. 在 \"OBS Setup\" 中点击 \"Click here to copy your URL\" 复制链接\n5. 在直播软件中添加浏览器源，将复制的 URL 填入\n\n### 方法三：使用 API 自行开发\n\n- 开发者可利用 Now Playing API 自行设计前端页面，并通过软件内置服务器进行本地部署\n\n- API 接口界面：\n\n![](/images/api_preview.png)\n\n---\n\n## 开发引导\n\n### 核心代码（Java）\n\n使用 IDEA 打开项目（需注意：请使用 JDK 11 运行）：\n\n| 操作 | 步骤                                                                          |\n|:---:|:----------------------------------------------------------------------------|\n| 运行 | 运行 `NowPlayingApplication` 类的 `main` 方法                                     |\n| 打包 | 依次双击 IDEA 右侧 Maven → Lifecycle 的 `clean` 和 `package`，在 `target` 目录下生成 JAR 包 |\n| JAR To EXE | 使用 [exe4j](https://www.ej-technologies.com/exe4j/download) 将 JAR 包转为 EXE    |\n\n### 外部程序（C#）\n\n`external_programs/AudioService/GetMusicStatus` 使用 VS Code 打开：\n\n| 操作 | 命令 |\n|:---:|:---|\n| 运行 | `dotnet run` |\n| 打包 | `dotnet publish -c Release -r win-x64 --self-contained -o ./publish` |\n\n---\n\n## 程序原理\n\n通过 `Assets/AudioService/GetMusicStatus.exe` 程序检测音乐软件的播放状态（Playing、Paused、None）和歌曲信息，通常情况下每隔 1 秒输出一次，当检测到歌曲状态变化时会立即输出。\n\n\u003cdetails\u003e\n\u003csummary\u003e点击展开详细原理\u003c/summary\u003e\n\n### 命令行参数\n\n接收命令行参数（具体取值请参考 [源码](https://github.com/Widdit/now-playing-service/blob/master/external_programs/AudioService/GetMusicStatus/Program.cs)）：\n\n| 参数 | 含义 | 描述 |\n|:---|:---|:---|\n| `--device-id` | 音频设备 ID | 仅检测该音频设备，默认值为 `default`，检测默认音频设备 |\n| `--platform` | 音乐平台 | 期望检测的音乐软件平台，默认值为 `netease`，检测网易云音乐 |\n| `--smtc` | 是否优先使用 SMTC | 优先通过 SMTC 识别歌曲信息，默认值为 `true` |\n| `--poll-interval` | 轮询间隔（ms） | 建议取值范围为 100~1000 ms，默认值为 `100` ms（最快） |\n\n### 独立运行示例\n\n`GetMusicStatus.exe` 程序可独立运行，运行示例如下图所示：\n\n![](/images/getMusicStatus_output.png)\n\n### 执行流程\n\n![](/images/flow_chart.png)\n\n\u003e **说明**：由于播放进度是通过算法逻辑计算出来的（无法直接获取），所以拖动进度条无法检测，但暂停动作可以检测到。该部分使用了 [这段代码](https://stackoverflow.com/questions/23182880/check-if-an-application-emits-sound) 来获取指定进程的实时音量，从而判断音乐是否暂停。\n\n\u003c/details\u003e\n\n---\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Widdit/now-playing-service\u0026type=date\u0026legend=top-left)](https://www.star-history.com/#Widdit/now-playing-service\u0026type=date\u0026legend=top-left)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiddit%2Fnow-playing-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiddit%2Fnow-playing-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiddit%2Fnow-playing-service/lists"}