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 9ee09302..cb158920 100644
Binary files a/dsLightRag/Routes/__pycache__/SunoRoute.cpython-310.pyc and b/dsLightRag/Routes/__pycache__/SunoRoute.cpython-310.pyc differ
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 00000000..9cd28cba
Binary files /dev/null and b/dsLightRag/Suno/__pycache__/__init__.cpython-310.pyc differ
diff --git a/dsLightRag/Routes/__pycache__/suno_music_generator.cpython-310.pyc b/dsLightRag/Suno/__pycache__/sunoUtil.cpython-310.pyc
similarity index 95%
rename from dsLightRag/Routes/__pycache__/suno_music_generator.cpython-310.pyc
rename to dsLightRag/Suno/__pycache__/sunoUtil.cpython-310.pyc
index e45569b3..bc8eb35a 100644
Binary files a/dsLightRag/Routes/__pycache__/suno_music_generator.cpython-310.pyc and b/dsLightRag/Suno/__pycache__/sunoUtil.cpython-310.pyc differ
diff --git a/dsLightRag/Routes/suno_music_generator.py b/dsLightRag/Suno/sunoUtil.py
similarity index 100%
rename from dsLightRag/Routes/suno_music_generator.py
rename to dsLightRag/Suno/sunoUtil.py
diff --git a/dsLightRag/static/Suno/index.html b/dsLightRag/static/Suno/index.html
index 75ae4f65..c389640a 100644
--- a/dsLightRag/static/Suno/index.html
+++ b/dsLightRag/static/Suno/index.html
@@ -129,14 +129,14 @@
-
+
-
示例:「夏日海边」「深夜治愈」「热血励志」
+ 示例:「夏日海边」「深夜治愈」「热血沥水」
+
+
+
@@ -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 @@
+
+
+
+
+
+
音乐生成进度
+
+
+
+
+
+
音乐生成进度
+
+
+
+
+ 正在准备生成音乐...
+
+
+
+
音乐已生成完成
+
+
+
+
+
返回创作页
+
+
+
+
+
\ No newline at end of file