1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2025-12-06 14:52:50 +08:00

Compare commits

...

39 Commits

Author SHA1 Message Date
涵曦
1d6f3d5164 bump: version 0.3.99 → 0.3.100 2025-11-09 14:58:06 +08:00
涵曦
1f3d80c387 build: update static version 2025-11-09 14:58:05 +08:00
Jhao
7bd0822452 feat: soundSpace兼容移动端 (#577)
* feat: SoundSpace Theme

* feat: add path aliases and base URL configuration in Vite(SoundSpace)

* feat: soundSpace兼容移动端
2025-11-09 14:38:14 +08:00
Issues Docs [BOT]
7d105184e0 Auto-Generate docs 🤖 2025-11-08 04:49:51 +00:00
Issues Docs [BOT]
a6841963e9 Auto-Generate docs 🤖 2025-11-06 02:32:17 +00:00
Issues Docs [BOT]
b9338f88e2 Auto-Generate docs 🤖 2025-11-04 01:11:56 +00:00
涵曦
f6e42b810b Update README.md 2025-11-04 09:09:40 +08:00
Issues Docs [BOT]
587ec84079 Auto-Generate docs 🤖 2025-11-02 13:09:21 +00:00
涵曦
340851f1c0 bump: version 0.3.98 → 0.3.99 2025-11-02 21:07:01 +08:00
涵曦
4e557521ce build: update static version 2025-11-02 21:07:00 +08:00
Issues Docs [BOT]
41e64fc486 Auto-Generate docs 🤖 2025-11-02 13:06:01 +00:00
涵曦
ba1ed2355e feat: 新增 SoundScape 主题 2025-11-02 21:03:52 +08:00
Jhao
6fa7074c4c feat: add path aliases and base URL configuration in Vite(SoundSpace) (#569)
* feat: SoundSpace Theme

* feat: add path aliases and base URL configuration in Vite(SoundSpace)
2025-11-02 20:24:01 +08:00
Jhao
0f3f25fe12 feat: SoundSpace Theme (#568) 2025-11-02 17:09:43 +08:00
Issues Docs [BOT]
9097763163 Auto-Generate docs 🤖 2025-11-02 03:35:48 +00:00
涵曦
1ab4d241a5 bump: version 0.3.97 → 0.3.98 2025-11-02 11:33:30 +08:00
涵曦
b4b1ba3391 build: update static version 2025-11-02 11:33:30 +08:00
涵曦
7764abeedc Update Dockerfile.builder 2025-11-02 10:51:14 +08:00
涵曦
eceb4294ed Update Dockerfile 2025-11-02 10:50:45 +08:00
Issues Docs [BOT]
43ba6c7875 Auto-Generate docs 🤖 2025-11-01 05:04:27 +00:00
涵曦
946be390ed bump: version 0.3.96 → 0.3.97 2025-11-01 13:02:13 +08:00
涵曦
5d32590c76 build: update static version 2025-11-01 13:02:12 +08:00
Issues Docs [BOT]
c0528342a1 Auto-Generate docs 🤖 2025-11-01 02:11:34 +00:00
Formatter [BOT]
9660079b02 Auto-format code 🧹🌟🤖 2025-11-01 02:09:09 +00:00
涵曦
f535fd149e feat: 升级 miservice 2025-11-01 10:08:34 +08:00
涵曦
34d1aab7f5 fix: 优化登录问题 2025-11-01 10:08:34 +08:00
Issues Docs [BOT]
7c8bde5808 Auto-Generate docs 🤖 2025-10-29 21:08:33 +00:00
Issues Docs [BOT]
4645bd393b Auto-Generate docs 🤖 2025-10-29 06:27:53 +00:00
涵曦
841962660e Update README.md 2025-10-29 14:25:59 +08:00
Issues Docs [BOT]
6c434dd7d6 Auto-Generate docs 🤖 2025-10-27 16:05:52 +00:00
涵曦
7680fa2dd6 bump: version 0.3.95 → 0.3.96 2025-10-28 00:03:37 +08:00
涵曦
3db75c64c2 build: update static version 2025-10-28 00:03:37 +08:00
Issues Docs [BOT]
6534066b7e Auto-Generate docs 🤖 2025-10-26 13:03:57 +00:00
涵曦
0e3576cf10 fix: tts问题临时处理 2025-10-26 20:53:27 +08:00
Issues Docs [BOT]
9fc4d8f5ee Auto-Generate docs 🤖 2025-10-26 04:24:17 +00:00
涵曦
a74546e8d6 bump: version 0.3.94 → 0.3.95 2025-10-26 12:22:08 +08:00
涵曦
d2fb5ab8d4 build: update static version 2025-10-26 12:22:08 +08:00
涵曦
e855ffd457 fix: 修复型号M01不能播放问题 2025-10-26 12:21:46 +08:00
Issues Docs [BOT]
71cdfd6cda Auto-Generate docs 🤖 2025-10-25 10:06:33 +00:00
30 changed files with 518 additions and 30 deletions

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "MiService"]
path = MiService
url = git@github.com:hanxi/MiService.git

View File

@@ -1,3 +1,41 @@
## v0.3.100 (2025-11-09)
### Feat
- soundSpace兼容移动端 (#577)
## v0.3.99 (2025-11-02)
### Feat
- 新增 SoundScape 主题
- add path aliases and base URL configuration in ViteSoundSpace (#569)
- SoundSpace Theme (#568)
## v0.3.98 (2025-11-02)
## v0.3.97 (2025-11-01)
### Feat
- 升级 miservice
### Fix
- 优化登录问题
## v0.3.96 (2025-10-28)
### Fix
- tts问题临时处理
## v0.3.95 (2025-10-26)
### Fix
- 修复型号M01不能播放问题
## v0.3.94 (2025-10-25)
### Fix

View File

@@ -7,7 +7,6 @@ COPY xiaomusic/ ./xiaomusic/
COPY plugins/ ./plugins/
COPY holiday/ ./holiday/
COPY xiaomusic.py .
COPY MiService/ ./MiService/
RUN pdm install --prod --no-editable -v
FROM hanxi/xiaomusic:runtime

View File

@@ -5,12 +5,10 @@ RUN pip install -U pdm
ENV PDM_CHECK_UPDATE=false
WORKDIR /app
COPY pyproject.toml README.md ./
COPY MiService/ ./MiService/
RUN pdm install --prod --no-editable -v
COPY xiaomusic/ ./xiaomusic/
COPY plugins/ ./plugins/
COPY holiday/ ./holiday/
COPY MiService/ ./MiService/
COPY xiaomusic.py .

Submodule MiService deleted from fc22a4e0de

View File

@@ -271,8 +271,6 @@ docker build -t xiaomusic .
## 📢 讨论区
- [点击链接加入QQ频道【xiaomusic】](https://pd.qq.com/s/e2jybz0ss)
- [点击链接加入群聊【满 xiaomusic官方交流群1】 604526973](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=13St5PLVcTxYlWTAs_iAawazjtdD1l-a&authKey=dJWEpaT2fDBDpdUUOWj%2FLt6NS1ePBfShDfz7a6seNURi05VvVnAGQzXF%2FM%2F5HgIm&noverify=0&group_code=604526973)
- [点击链接加入群聊【xiaomusic官方交流群2】1021062499](https://qm.qq.com/q/BmVNqhDL3M)
- [点击链接加入群聊【xiaomusic官方交流群3】 1072151477](https://qm.qq.com/q/lxIhquqbza)
- <https://github.com/hanxi/xiaomusic/issues>
- [微信群二维码](https://github.com/hanxi/xiaomusic/issues/86)
@@ -290,6 +288,7 @@ docker build -t xiaomusic .
- [pure 主题 xiaomusicUI](https://github.com/52fisher/xiaomusicUI)
- [移动端的播放器主题](https://github.com/52fisher/XMusicPlayer)
- [Tailwind主题](https://github.com/clarencejh/xiaomusic)
- [SoundScape主题](https://github.com/jhao0413/SoundScape)
- [一个第三方的主题](https://github.com/DarrenWen/xiaomusicui)
- [Umami 统计](https://github.com/umami-software/umami)
- [Sentry 报错监控](https://github.com/getsentry/sentry)

View File

@@ -263,5 +263,19 @@ https://tutu.to/image/1.N0FHK
同样问题,但我重新使用 [视频教程-群晖1]进行部署就正常了
---
### 评论 28 - davedday
这个支持在远程VPS上docker部署然后本地小爱同学使用吗
---
### 评论 29 - hanxi
> 这个支持在远程VPS上docker部署然后本地小爱同学使用吗
支持的,请不要在不相关的话题下面问。
---
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/211)

View File

@@ -4,7 +4,7 @@ title: 微信交流群二维码
# 微信交流群二维码
<img width="1031" height="1440" alt="Image" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/ea6aeb44-69cf-4a6a-a46c-ebab6dbf657a" />
<img width="1031" height="1440" alt="Image" src="https://gproxy.hanxi.cc/proxy/user-attachments/assets/6f95ce97-3699-4df7-93ce-b280c024b2b8" />
## 评论

View File

@@ -1906,5 +1906,11 @@ Bilibili现在也需要cookies建议作者大大改一下改一下说明。
大佬可以进个群吗?
---
### 评论 131 - lucklyday2023
L06A 测试-播放文字无效web界面和语音控制无提示音
---
[链接到 GitHub Issue](https://github.com/hanxi/xiaomusic/issues/99)

View File

@@ -1,5 +1,43 @@
# 版本日志
## v0.3.99 (2025-11-02)
### Feat
- 新增 SoundScape 主题
- add path aliases and base URL configuration in ViteSoundSpace (#569)
- SoundSpace Theme (#568)
## v0.3.98 (2025-11-02)
## v0.3.97 (2025-11-01)
### Feat
- 升级 miservice
### Fix
- 优化登录问题
## v0.3.96 (2025-10-28)
### Fix
- tts问题临时处理
## v0.3.95 (2025-10-26)
### Fix
- 修复型号M01不能播放问题
## v0.3.94 (2025-10-25)
### Fix
- 尝试修复登录问题
## v0.3.93 (2025-10-25)
### Fix

View File

@@ -271,8 +271,6 @@ docker build -t xiaomusic .
## 📢 讨论区
- [点击链接加入QQ频道【xiaomusic】](https://pd.qq.com/s/e2jybz0ss)
- [点击链接加入群聊【满 xiaomusic官方交流群1】 604526973](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=13St5PLVcTxYlWTAs_iAawazjtdD1l-a&authKey=dJWEpaT2fDBDpdUUOWj%2FLt6NS1ePBfShDfz7a6seNURi05VvVnAGQzXF%2FM%2F5HgIm&noverify=0&group_code=604526973)
- [点击链接加入群聊【xiaomusic官方交流群2】1021062499](https://qm.qq.com/q/BmVNqhDL3M)
- [点击链接加入群聊【xiaomusic官方交流群3】 1072151477](https://qm.qq.com/q/lxIhquqbza)
- <https://github.com/hanxi/xiaomusic/issues>
- [微信群二维码](https://github.com/hanxi/xiaomusic/issues/86)
@@ -290,6 +288,7 @@ docker build -t xiaomusic .
- [pure 主题 xiaomusicUI](https://github.com/52fisher/xiaomusicUI)
- [移动端的播放器主题](https://github.com/52fisher/XMusicPlayer)
- [Tailwind主题](https://github.com/clarencejh/xiaomusic)
- [SoundScape主题](https://github.com/jhao0413/SoundScape)
- [一个第三方的主题](https://github.com/DarrenWen/xiaomusicui)
- [Umami 统计](https://github.com/umami-software/umami)
- [Sentry 报错监控](https://github.com/getsentry/sentry)

View File

@@ -2,6 +2,204 @@
"$schema": "https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/schema.json",
"$id": "https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/2026.json",
"year": 2026,
"papers": [],
"days": []
"papers": [
"https://www.gov.cn/zhengce/zhengceku/202511/content_7047091.htm"
],
"days": [
{
"name": "元旦",
"date": "2026-01-01",
"isOffDay": true
},
{
"name": "元旦",
"date": "2026-01-02",
"isOffDay": true
},
{
"name": "元旦",
"date": "2026-01-03",
"isOffDay": true
},
{
"name": "元旦",
"date": "2026-01-04",
"isOffDay": false
},
{
"name": "春节",
"date": "2026-02-14",
"isOffDay": false
},
{
"name": "春节",
"date": "2026-02-15",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-16",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-17",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-18",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-19",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-20",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-21",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-22",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-23",
"isOffDay": true
},
{
"name": "春节",
"date": "2026-02-28",
"isOffDay": false
},
{
"name": "清明节",
"date": "2026-04-04",
"isOffDay": true
},
{
"name": "清明节",
"date": "2026-04-05",
"isOffDay": true
},
{
"name": "清明节",
"date": "2026-04-06",
"isOffDay": true
},
{
"name": "劳动节",
"date": "2026-05-01",
"isOffDay": true
},
{
"name": "劳动节",
"date": "2026-05-02",
"isOffDay": true
},
{
"name": "劳动节",
"date": "2026-05-03",
"isOffDay": true
},
{
"name": "劳动节",
"date": "2026-05-04",
"isOffDay": true
},
{
"name": "劳动节",
"date": "2026-05-05",
"isOffDay": true
},
{
"name": "劳动节",
"date": "2026-05-09",
"isOffDay": false
},
{
"name": "端午节",
"date": "2026-06-19",
"isOffDay": true
},
{
"name": "端午节",
"date": "2026-06-20",
"isOffDay": true
},
{
"name": "端午节",
"date": "2026-06-21",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-09-20",
"isOffDay": false
},
{
"name": "中秋节",
"date": "2026-09-25",
"isOffDay": true
},
{
"name": "中秋节",
"date": "2026-09-26",
"isOffDay": true
},
{
"name": "中秋节",
"date": "2026-09-27",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-01",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-02",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-03",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-04",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-05",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-06",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-07",
"isOffDay": true
},
{
"name": "国庆节",
"date": "2026-10-10",
"isOffDay": false
}
]
}

View File

@@ -1,6 +1,6 @@
[project]
name = "xiaomusic"
version = "0.3.94"
version = "0.3.100"
description = "Play Music with xiaomi AI speaker"
authors = [
{name = "涵曦", email = "im.hanxi@gmail.com"},
@@ -24,7 +24,8 @@ dependencies = [
"python-socketio>=5.12.1",
"pyjwt>=2.10.1",
"fake-useragent>=2.2.0",
"miservice-fork @ file:///${PROJECT_ROOT}/MiService",
"miservice-fork",
"edge-tts>=7.2.3",
]
requires-python = ">=3.10"
readme = "README.md"

View File

@@ -1 +1 @@
__version__ = "0.3.94"
__version__ = "0.3.100"

View File

@@ -6,9 +6,9 @@
<meta name="viewport" content="width=device-width">
<title>Debug For XiaoMusic</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1761386557">
<link rel="stylesheet" type="text/css" href="./main.css?version=1762671468">
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script src="./jquery-3.7.1.min.js?version=1761386557"></script>
<script src="./jquery-3.7.1.min.js?version=1762671468"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>

View File

@@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>歌曲下载工具</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1761386557">
<script src="./jquery-3.7.1.min.js?version=1761386557"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1762671468">
<script src="./jquery-3.7.1.min.js?version=1762671468"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>

View File

@@ -5,8 +5,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小爱音箱操控面板</title>
<script src="./jquery-3.7.1.min.js?version=1761386557"></script>
<link rel="stylesheet" href="./main.css?version=1761386557">
<script src="./jquery-3.7.1.min.js?version=1762671468"></script>
<link rel="stylesheet" href="./main.css?version=1762671468">
<link rel="icon" href="./favicon.ico">
<!-- Google tag (gtag.js) -->
@@ -196,7 +196,7 @@
Powered by XiaoMusic
</div>
<script src="./md.js?version=1761386557">
<script src="./md.js?version=1762671468">
</script>
</body>

View File

@@ -5,7 +5,7 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width">
<title>M3U to JSON Converter</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1761386557">
<link rel="stylesheet" type="text/css" href="./main.css?version=1762671468">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>

View File

@@ -4,9 +4,9 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width">
<title>小爱音箱操控面板</title>
<script src="./jquery-3.7.1.min.js?version=1761386557"></script>
<script src="./setting.js?version=1761386557"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1761386557">
<script src="./jquery-3.7.1.min.js?version=1762671468"></script>
<script src="./setting.js?version=1762671468"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1762671468">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>

View File

@@ -60,6 +60,9 @@
<div class="options_list">
<a href="/static/xplayer/index.html">XMusicPlayer</a>
</div>
<div class="options_list">
<a href="/static/soundSpace/index.html">SoundSpace</a>
</div>
<div class="options_list weapp">
<a href="https://github.com/F-loat/xiaoplayer" target="_blank">微信小程序</a>
<iframe width="240px" height="240px" src="/static/weapp/qrcode.html"></iframe>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
import{O as a}from"./features-animation-ewycTM2u.js";import"./index-DDyFjb4P.js";var i=a;export{i as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
import{O as a}from"./features-animation-ewycTM2u.js";import"./index-DDyFjb4P.js";var t=a;export{t as default};

14
xiaomusic/static/soundSpace/index.html vendored Normal file
View File

@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/static/soundSpace/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>soundscape</title>
<script type="module" crossorigin src="/static/soundSpace/assets/index-DDyFjb4P.js"></script>
<link rel="stylesheet" crossorigin href="/static/soundSpace/assets/index-qfFWjqIn.css">
</head>
<body>
<div id="root"></div>
</body>
</html>

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -24,10 +24,12 @@ from collections import OrderedDict
from collections.abc import AsyncIterator
from dataclasses import asdict, dataclass
from http.cookies import SimpleCookie
from pathlib import Path
from time import sleep
from urllib.parse import parse_qs, urlparse
import aiohttp
import edge_tts
import mutagen
from mutagen.asf import ASF
from mutagen.flac import FLAC
@@ -1466,3 +1468,41 @@ class MusicUrlCache:
def size(self) -> int:
"""当前缓存大小"""
return len(self.cache)
async def text_to_mp3(
text: str, save_dir: str, voice: str = "zh-CN-XiaoxiaoNeural"
) -> str:
"""
使用edge-tts将文本转换为MP3语音文件
参数:
text: 需要转换的文本内容
save_dir: 保存MP3文件的目录路径
voice: 语音模型(默认中文晓晓)
返回:
str: 生成的MP3文件完整路径
"""
# 确保保存目录存在
Path(save_dir).mkdir(parents=True, exist_ok=True)
# 基于文本和语音模型生成唯一文件名(避免相同文本不同语音重复)
content = f"{text}_{voice}".encode()
file_hash = hashlib.md5(content).hexdigest()
mp3_filename = f"{file_hash}.mp3"
mp3_path = os.path.join(save_dir, mp3_filename)
# 文件已存在直接返回路径
if os.path.exists(mp3_path):
return mp3_path
# 调用edge-tts生成语音
try:
communicate = edge_tts.Communicate(text, voice)
await communicate.save(mp3_path)
log.info(f"语音文件生成成功: {mp3_path}")
except Exception as e:
raise RuntimeError(f"生成语音文件失败: {e}") from e
return mp3_path

View File

@@ -1558,6 +1558,8 @@ class XiaoMusic:
device_list = await self.mina_service.device_list()
except Exception as e:
self.log.warning(f"Execption {e}")
# 重新初始化
await self.xiaomusic.reinit()
return device_list
async def debug_play_by_music_url(self, arg1=None):
@@ -2061,8 +2063,6 @@ class XiaoMusicDevice:
await self.xiaomusic.mina_service.text_to_speech(self.device_id, value)
except Exception as e:
self.log.exception(f"Execption {e}")
# 重新初始化
await self.xiaomusic.reinit()
# 同一组设备播放
async def group_player_play(self, url, name=""):