From 5fda2cfeafeaa82b7f9466b7b59353fecd79784d Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Thu, 21 Aug 2025 14:24:35 +0800 Subject: [PATCH] 'commit' --- dsLightRag/Routes/SunoRoute.py | 2 +- .../__pycache__/SunoRoute.cpython-310.pyc | Bin 5115 -> 5101 bytes dsLightRag/Suno/__init__.py | 0 .../Suno/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 140 bytes .../__pycache__/sunoUtil.cpython-310.pyc} | Bin 5684 -> 5670 bytes .../sunoUtil.py} | 0 dsLightRag/static/Suno/index.html | 30 ++-- dsLightRag/static/Suno/music_progress.html | 135 ++++++++++++++++++ 8 files changed, 157 insertions(+), 10 deletions(-) create mode 100644 dsLightRag/Suno/__init__.py create mode 100644 dsLightRag/Suno/__pycache__/__init__.cpython-310.pyc rename dsLightRag/{Routes/__pycache__/suno_music_generator.cpython-310.pyc => Suno/__pycache__/sunoUtil.cpython-310.pyc} (95%) rename dsLightRag/{Routes/suno_music_generator.py => Suno/sunoUtil.py} (100%) create mode 100644 dsLightRag/static/Suno/music_progress.html diff --git a/dsLightRag/Routes/SunoRoute.py b/dsLightRag/Routes/SunoRoute.py index 3de2678f..583b580f 100644 --- a/dsLightRag/Routes/SunoRoute.py +++ b/dsLightRag/Routes/SunoRoute.py @@ -9,7 +9,7 @@ import fastapi from fastapi import APIRouter, HTTPException, Query from pydantic import BaseModel -from Routes.suno_music_generator import SunoMusicGenerator +from Suno.sunoUtil import SunoMusicGenerator from Config import Config # 创建路由路由器 diff --git a/dsLightRag/Routes/__pycache__/SunoRoute.cpython-310.pyc b/dsLightRag/Routes/__pycache__/SunoRoute.cpython-310.pyc index 9ee093021d0347d716a39b371c39135975111942..cb1589208487beb2fc80f0e1cc41630d0cc35bad 100644 GIT binary patch delta 41 ucmeyZ{#KngpO=@50SLl&Ez5A*$SWtz#~WOlm#{#%_lpO=@50SF>?EXxSl$SWr-BOR1qT9R6%VoS7V-o|>0hlvt8q JG}%&k3jphW6CD5m diff --git a/dsLightRag/Suno/__init__.py b/dsLightRag/Suno/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/dsLightRag/Suno/__pycache__/__init__.cpython-310.pyc b/dsLightRag/Suno/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9cd28cbae958b9b4bab71cacea9f662ebf9d122a GIT binary patch literal 140 zcmd1j<>g`k0^427GC=fW5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!H%i&acYad>`F zHjoM^%FjwoE&;N9GSf3kf)dkXf=l!AW8&j8^D;}~请选择情绪与场景 - + -
示例:「夏日海边」「深夜治愈」「热血励志」
+
示例:「夏日海边」「深夜治愈」「热血沥水」
@@ -197,6 +197,13 @@
添加教学科目可以让音乐更贴合特定学科的学习氛围
+ +
+ + +
请输入0.5-10分钟之间的时长,步长0.5分钟
+
+
@@ -231,7 +238,8 @@ tempo: "4/4 拍 120 BPM", instruments: "吉他+贝斯+鼓", theme: "快乐学习", - teachingSubject: "英语" + teachingSubject: "英语", + duration: 2 // 添加时长字段 }, { style: "古风", @@ -240,7 +248,8 @@ tempo: "4/4 拍 80 BPM", instruments: "笛子+古筝", theme: "诗词歌赋", - teachingSubject: "语文" + teachingSubject: "语文", + duration: 3 // 添加时长字段 }, { style: "Classical", @@ -249,7 +258,8 @@ tempo: "3/4 拍 90 BPM", instruments: "钢琴弦乐", theme: "数学的旋律", - teachingSubject: "数学" + teachingSubject: "数学", + duration: 4 // 添加时长字段 }, { style: "民谣", @@ -280,7 +290,7 @@ }, { style: "摇滚", - mood: "热血励志", + mood: "热血沥水", vocal: "高亢女声", tempo: "4/4 拍 140 BPM", instruments: "吉他+贝斯+鼓", @@ -321,7 +331,8 @@ document.getElementById('instruments').value = sample.instruments; document.getElementById('theme').value = sample.theme; document.getElementById('teachingSubject').value = sample.teachingSubject; - + document.getElementById('duration').value = sample.duration; // 填充时长 + // 隐藏结果区域 resultContainer.style.display = 'none'; }); @@ -338,13 +349,14 @@ const instruments = document.getElementById('instruments').value; const theme = document.getElementById('theme').value; const teachingSubject = document.getElementById('teachingSubject').value; - + const duration = document.getElementById('duration').value; // 获取时长 + // 生成提示词 let prompt = `${style} ${mood},${vocal},${tempo},配${instruments},主题围绕'${theme}'`; if (teachingSubject) { prompt += `,适合${teachingSubject}教学使用`; } - prompt += `,时长 2 分钟。`; + prompt += `,时长${duration}分钟。`; // 添加时长到提示词 // 显示结果 resultContent.textContent = prompt; diff --git a/dsLightRag/static/Suno/music_progress.html b/dsLightRag/static/Suno/music_progress.html new file mode 100644 index 00000000..df236d1c --- /dev/null +++ b/dsLightRag/static/Suno/music_progress.html @@ -0,0 +1,135 @@ + + + + + + 音乐生成进度 + + + + +
+

音乐生成进度

+ +
+
生成进度
+
+
0%
+
+
+ +
+ 正在准备生成音乐... +
+ +
+

音乐已生成完成

+
+ +
+ + 返回创作页 +
+ + + + \ No newline at end of file