Opera8 commited on
Commit
3a0ef3e
·
verified ·
1 Parent(s): 4741934

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +62 -86
index.html CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>استودیو پیشرفته کلونینگ صدا | AI Alpha</title>
7
  <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
@@ -35,102 +35,81 @@
35
  </head>
36
  <body class="text-slate-100 min-h-screen flex items-center justify-center p-4 md:p-8">
37
 
38
- <div class="w-full max-w-4xl glass-panel rounded-3xl p-6 md:p-10 shadow-2xl relative overflow-hidden">
39
  <div class="absolute -top-24 -left-24 w-48 h-48 bg-indigo-500/10 rounded-full blur-3xl"></div>
40
  <div class="absolute -bottom-24 -right-24 w-48 h-48 bg-purple-500/10 rounded-full blur-3xl"></div>
41
 
42
- <div class="flex flex-col md:flex-row justify-between items-center border-b border-slate-700/50 pb-6 mb-8 gap-4">
43
- <div class="flex items-center gap-4 text-center md:text-right">
44
- <div class="w-12 h-12 bg-indigo-600/20 border border-indigo-500/30 rounded-2xl flex items-center justify-center text-indigo-400 text-2xl shadow-inner">
 
45
  <i class="fa-solid fa-fingerprint"></i>
46
  </div>
47
  <div>
48
- <h1 class="text-xl md:text-2xl font-extrabold bg-gradient-to-l from-indigo-200 to-indigo-400 bg-clip-text text-transparent">استودیو حرفه‌ای شبیه‌سازی صدا</h1>
49
- <p class="text-xs text-slate-400 mt-1">پلتفرم فوق‌پیشرفته ساخت شناسنامه صوتی و متن به صدا</p>
50
  </div>
51
  </div>
52
- <div class="bg-slate-800/80 border border-slate-700/60 px-4 py-1.5 rounded-full text-xs text-indigo-300 flex items-center gap-2">
53
- <span class="w-2 h-2 bg-emerald-500 rounded-full animate-pulse"></span>
54
- موتور هوشمند تشخیص خودکار زبان (Auto-Detect)
55
- </div>
56
  </div>
57
 
58
- <div class="grid grid-cols-1 md:grid-cols-12 gap-8">
 
59
 
60
- <div class="md:col-span-7 flex flex-col gap-5">
61
- <div>
62
- <label class="block text-sm font-semibold text-slate-300 mb-2"><i class="fa-solid fa-file-lines text-indigo-400 ml-2"></i>متن هدف برای خوانش صوتی:</label>
63
- <textarea id="text" class="w-full h-32 bg-slate-900/60 border border-slate-700/50 rounded-xl p-4 text-slate-200 placeholder-slate-500 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none transition-all resize-none text-sm leading-relaxed" placeholder="متنی که می‌خواهید مدل با صدای کلون شده بخواند را وارد کنید..."></textarea>
64
- </div>
65
-
66
- <div>
67
- <label class="block text-sm font-semibold text-slate-300 mb-2"><i class="fa-solid fa-microphone-lines text-indigo-400 ml-2"></i>بارگذاری نمونه صدای مرجع (Reference Audio):</label>
68
- <div id="drop-zone" class="border-2 border-dashed border-slate-700 hover:border-indigo-500/50 bg-slate-900/30 rounded-xl p-6 text-center cursor-pointer transition-all relative group">
69
- <input type="file" id="ref_audio" accept="audio/*" class="absolute inset-0 w-full h-full opacity-0 cursor-pointer">
70
- <div class="text-indigo-400 text-3xl mb-2 group-hover:scale-110 transition-transform"><i class="fa-solid fa-cloud-arrow-up"></i></div>
71
- <p id="file-info" class="text-xs text-slate-400">فایل صوتی گوینده را بکشید و اینجا رها کنید یا <span class="text-indigo-400 font-medium">کلیک کنید</span></p>
72
- <p class="text-[10px] text-slate-500 mt-1">فرمت‌های مجاز: MP3, WAV, M4A (حداقل ۵ ثانیه برای کیفیت برتر)</p>
73
- </div>
74
- </div>
75
 
76
- <div>
77
- <label class="block text-sm font-semibold text-slate-300 mb-2"><i class="fa-solid fa-quote-right text-indigo-400 ml-2"></i>متن خوانده شده در فایل نمونه (اختیاری):</label>
78
- <input type="text" id="ref_text" class="w-full bg-slate-900/60 border border-slate-700/50 rounded-xl p-3 text-slate-200 placeholder-slate-500 focus:border-indigo-500 outline-none text-xs" placeholder="گوینده در فایل صوتی بالا دقیقاً چه جمله‌ای می‌گوید؟">
 
 
 
 
 
 
 
79
  </div>
80
  </div>
81
 
82
- <div class="md:col-span-5 flex flex-col justify-between gap-6">
83
- <div class="flex flex-col gap-5">
84
- <div>
85
- <label class="block text-sm font-semibold text-slate-300 mb-2"><i class="fa-solid fa-wand-magic-sparkles text-indigo-400 ml-2"></i>تنظیم دستور احساس و لحن صوتی (Instruct):</label>
86
- <input type="text" id="instruct" class="w-full bg-slate-900/60 border border-slate-700/50 rounded-xl p-3 text-slate-200 placeholder-slate-500 focus:border-indigo-500 outline-none text-xs" placeholder="مثلا: whisper یا female, high pitch">
87
-
88
- <div class="flex flex-wrap gap-1.5 mt-2">
89
- <span onclick="setInstruct('whisper')" class="bg-slate-800 hover:bg-indigo-900/40 border border-slate-700/60 text-[10px] text-slate-300 px-2.5 py-1 rounded-md cursor-pointer transition-all">پچپچ 🤫</span>
90
- <span onclick="setInstruct('male, low pitch')" class="bg-slate-800 hover:bg-indigo-900/40 border border-slate-700/60 text-[10px] text-slate-300 px-2.5 py-1 rounded-md cursor-pointer transition-all">مردانه بم 🧔</span>
91
- <span onclick="setInstruct('female, high pitch')" class="bg-slate-800 hover:bg-indigo-900/40 border border-slate-700/60 text-[10px] text-slate-300 px-2.5 py-1 rounded-md cursor-pointer transition-all">زنانه نازک 👩</span>
92
- <span onclick="setInstruct('young adult')" class="bg-slate-800 hover:bg-indigo-900/40 border border-slate-700/60 text-[10px] text-slate-300 px-2.5 py-1 rounded-md cursor-pointer transition-all">جوان ⚡</span>
93
- </div>
94
- </div>
95
 
96
- <div class="grid grid-cols-2 gap-4">
97
- <div>
98
- <label class="block text-xs font-semibold text-slate-400 mb-1.5">سرعت خروجی:</label>
99
- <select id="speed" class="w-full bg-slate-900/60 border border-slate-700/50 rounded-xl p-2.5 text-slate-200 text-xs outline-none focus:border-indigo-500">
100
- <option value="1.0">1.0 (معمولی)</option>
101
- <option value="0.85">0.85 (کمی آرام)</option>
102
- <option value="1.15">1.15 (کمی سریع)</option>
103
- </select>
104
- </div>
105
- <div>
106
- <label class="block text-xs font-semibold text-slate-400 mb-1.5">کیفیت پردازش (Steps):</label>
107
- <input type="text" id="steps" class="w-full bg-slate-900/60 border border-slate-700/50 rounded-xl p-2.5 text-slate-200 text-xs outline-none text-center focus:border-indigo-500" value="32">
108
- </div>
109
  </div>
 
110
  </div>
111
 
112
- <div class="bg-slate-900/40 border border-slate-800 rounded-2xl p-4 flex flex-col gap-4">
113
- <button id="submit-btn" class="w-full bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 text-white font-bold py-3.5 px-4 rounded-xl cursor-pointer glow-button flex items-center justify-center gap-2 transition-all text-sm">
114
- <i class="fa-solid fa-bolt"></i>
115
- <span>تولید فرکانس و کلون‌سازی صدا</span>
116
- </button>
117
-
118
- <div id="status-container" class="hidden flex flex-col items-center justify-center py-2 text-center">
119
- <div class="flex items-end gap-1 h-8 mb-2">
120
- <div class="w-1 bg-indigo-500 rounded-full wave-bar" style="animation-delay: 0.1s"></div>
121
- <div class="w-1 bg-purple-500 rounded-full wave-bar" style="animation-delay: 0.3s"></div>
122
- <div class="w-1 bg-pink-500 rounded-full wave-bar" style="animation-delay: 0.5s"></div>
123
- <div class="w-1 bg-indigo-400 rounded-full wave-bar" style="animation-delay: 0.2s"></div>
124
- </div>
125
- <div id="status" class="text-xs text-slate-400 font-medium">در انتظار دستور...</div>
126
- </div>
127
-
128
- <div id="player-container" class="hidden border-t border-slate-800/80 pt-2">
129
- <audio id="audio-output" controls class="w-full h-10 rounded-lg outline-none bg-slate-900"></audio>
130
- </div>
131
  </div>
132
-
133
  </div>
 
134
  </div>
135
  </div>
136
 
@@ -153,10 +132,6 @@
153
  }
154
  });
155
 
156
- function setInstruct(val) {
157
- document.getElementById('instruct').value = val;
158
- }
159
-
160
  function generateSessionHash() {
161
  return Math.random().toString(36).substring(2, 13);
162
  }
@@ -168,7 +143,7 @@
168
  view.setUint32(4, 36 + pcmArray.length * 2, true);
169
  view.setUint32(8, 0x45564157, true);
170
  view.setUint32(12, 0x20746d66, true);
171
- view.setUint32(16, 16, true);
172
  view.setUint16(20, 1, true);
173
  view.setUint16(22, 1, true);
174
  view.setUint32(24, samplingRate, true);
@@ -212,17 +187,18 @@
212
  statusDiv.innerText = 'اتصال به صف پردازش گرافیکی مانیتورینگ سرور...';
213
  const sessionHash = generateSessionHash();
214
 
 
215
  const queuePayload = {
216
  "data": [
217
  text, // 0: متن اصلی
218
  "Auto", // 1: زبان خودکار
219
  uploadedFileData, // 2: فایل صوتی کلوین
220
- document.getElementById('ref_text').value.trim() || null, // 3: متن فایل کلون
221
- document.getElementById('instruct').value.trim() || "", // 4: دستور لحن صوتی
222
- parseInt(document.getElementById('steps').value) || 32, // 5: تعداد استپس کیفیت
223
- 3.0, // 6: guidance_scale (اصلاح شد: روی 3.0 ست شد که کمتر از حداکثر مجاز 4.0 سرور است)
224
  true, // 7: denoise
225
- parseFloat(document.getElementById('speed').value), // 8: سرعت صدا
226
  1.0, // 9: مدت زمان ثابت بهینه کلون
227
  true, // 10: پیش‌پردازش
228
  true, // 11: پس‌پردازش
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>استودیو ساده کلونینگ صدا | AI Alpha</title>
7
  <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
  <style>
 
35
  </head>
36
  <body class="text-slate-100 min-h-screen flex items-center justify-center p-4 md:p-8">
37
 
38
+ <div class="w-full max-w-2xl glass-panel rounded-3xl p-6 md:p-8 shadow-2xl relative overflow-hidden">
39
  <div class="absolute -top-24 -left-24 w-48 h-48 bg-indigo-500/10 rounded-full blur-3xl"></div>
40
  <div class="absolute -bottom-24 -right-24 w-48 h-48 bg-purple-500/10 rounded-full blur-3xl"></div>
41
 
42
+ <!-- هدر -->
43
+ <div class="flex flex-col sm:flex-row justify-between items-center border-b border-slate-700/50 pb-5 mb-6 gap-4">
44
+ <div class="flex items-center gap-3.5 text-center sm:text-right">
45
+ <div class="w-10 h-10 bg-indigo-600/20 border border-indigo-500/30 rounded-xl flex items-center justify-center text-indigo-400 text-xl shadow-inner">
46
  <i class="fa-solid fa-fingerprint"></i>
47
  </div>
48
  <div>
49
+ <h1 class="text-lg md:text-xl font-extrabold bg-gradient-to-l from-indigo-200 to-indigo-400 bg-clip-text text-transparent">شبیه‌سازی ساده صدا</h1>
50
+ <p class="text-[10px] text-slate-400 mt-0.5">تبدیل سریع متن به صدا با نمونه صدای دلخواه</p>
51
  </div>
52
  </div>
 
 
 
 
53
  </div>
54
 
55
+ <!-- فرم اصلی -->
56
+ <div class="flex flex-col gap-5">
57
 
58
+ <!-- متن هدف -->
59
+ <div>
60
+ <label class="block text-xs md:text-sm font-semibold text-slate-300 mb-2">
61
+ <i class="fa-solid fa-file-lines text-indigo-400 ml-1.5"></i>متن هدف برای خوانش صوتی:
62
+ </label>
63
+ <textarea id="text" class="w-full h-28 bg-slate-900/60 border border-slate-700/50 rounded-xl p-3.5 text-slate-200 placeholder-slate-500 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none transition-all resize-none text-xs md:text-sm leading-relaxed" placeholder="متنی که می‌خواهید با صدای شبیه‌سازی‌شده خوانده شود را بنویسید..."></textarea>
64
+ </div>
 
 
 
 
 
 
 
 
65
 
66
+ <!-- بارگذاری نمونه صدا -->
67
+ <div>
68
+ <label class="block text-xs md:text-sm font-semibold text-slate-300 mb-2">
69
+ <i class="fa-solid fa-microphone-lines text-indigo-400 ml-1.5"></i>بارگذاری نمونه صدای مرجع:
70
+ </label>
71
+ <div id="drop-zone" class="border-2 border-dashed border-slate-700 hover:border-indigo-500/50 bg-slate-900/30 rounded-xl p-5 text-center cursor-pointer transition-all relative group">
72
+ <input type="file" id="ref_audio" accept="audio/*" class="absolute inset-0 w-full h-full opacity-0 cursor-pointer">
73
+ <div class="text-indigo-400 text-2xl mb-1.5 group-hover:scale-110 transition-transform"><i class="fa-solid fa-cloud-arrow-up"></i></div>
74
+ <p id="file-info" class="text-xs text-slate-400">فایل صوتی گوینده را بکشید و اینجا رها کنید یا <span class="text-indigo-400 font-medium">کلیک کنید</span></p>
75
+ <p class="text-[10px] text-slate-500 mt-1">فرمت‌های مجاز: MP3, WAV, M4A</p>
76
  </div>
77
  </div>
78
 
79
+ <!-- تنظیم سرعت خروجی -->
80
+ <div>
81
+ <label class="block text-xs md:text-sm font-semibold text-slate-300 mb-2">
82
+ <i class="fa-solid fa-gauge-high text-indigo-400 ml-1.5"></i>سرعت خروجی صدا:
83
+ </label>
84
+ <select id="speed" class="w-full bg-slate-900/60 border border-slate-700/50 rounded-xl p-2.5 text-slate-200 text-xs outline-none focus:border-indigo-500">
85
+ <option value="1.0">1.0 (معمولی و استاندارد)</option>
86
+ <option value="0.85">0.85 (کمی آرامتر)</option>
87
+ <option value="1.15">1.15 می سریع‌تر)</option>
88
+ </select>
89
+ </div>
 
 
90
 
91
+ <!-- بخش عملیات و پخش‌کننده -->
92
+ <div class="bg-slate-900/40 border border-slate-800 rounded-2xl p-4 flex flex-col gap-4 mt-2">
93
+ <button id="submit-btn" class="w-full bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 text-white font-bold py-3 px-4 rounded-xl cursor-pointer glow-button flex items-center justify-center gap-2 transition-all text-xs md:text-sm">
94
+ <i class="fa-solid fa-bolt"></i>
95
+ <span>شروع کلون‌سازی و تولید صدا</span>
96
+ </button>
97
+
98
+ <div id="status-container" class="hidden flex flex-col items-center justify-center py-2 text-center">
99
+ <div class="flex items-end gap-1 h-8 mb-2">
100
+ <div class="w-1 bg-indigo-500 rounded-full wave-bar" style="animation-delay: 0.1s"></div>
101
+ <div class="w-1 bg-purple-500 rounded-full wave-bar" style="animation-delay: 0.3s"></div>
102
+ <div class="w-1 bg-pink-500 rounded-full wave-bar" style="animation-delay: 0.5s"></div>
103
+ <div class="w-1 bg-indigo-400 rounded-full wave-bar" style="animation-delay: 0.2s"></div>
104
  </div>
105
+ <div id="status" class="text-[11px] text-slate-400 font-medium">در انتظار دستور...</div>
106
  </div>
107
 
108
+ <div id="player-container" class="hidden border-t border-slate-800/80 pt-2">
109
+ <audio id="audio-output" controls class="w-full h-10 rounded-lg outline-none bg-slate-900"></audio>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  </div>
 
111
  </div>
112
+
113
  </div>
114
  </div>
115
 
 
132
  }
133
  });
134
 
 
 
 
 
135
  function generateSessionHash() {
136
  return Math.random().toString(36).substring(2, 13);
137
  }
 
143
  view.setUint32(4, 36 + pcmArray.length * 2, true);
144
  view.setUint32(8, 0x45564157, true);
145
  view.setUint32(12, 0x20746d66, true);
146
+ view.setUint16(16, 16, true);
147
  view.setUint16(20, 1, true);
148
  view.setUint16(22, 1, true);
149
  view.setUint32(24, samplingRate, true);
 
187
  statusDiv.innerText = 'اتصال به صف پردازش گرافیکی مانیتورینگ سرور...';
188
  const sessionHash = generateSessionHash();
189
 
190
+ // در این بخش پارامترهای اختیاریِ حذف شده از ظاهر، به صورت پیش‌فرض تنظیم شده‌اند.
191
  const queuePayload = {
192
  "data": [
193
  text, // 0: متن اصلی
194
  "Auto", // 1: زبان خودکار
195
  uploadedFileData, // 2: فایل صوتی کلوین
196
+ null, // 3: متن فایل کلون (بدون تغییر)
197
+ "", // 4: دستور لحن صوتی (پیش‌فرض بدون تغییر)
198
+ 32, // 5: تعداد استپس کیفیت (پیش‌فرض 32)
199
+ 3.0, // 6: guidance_scale
200
  true, // 7: denoise
201
+ parseFloat(document.getElementById('speed').value), // 8: سرعت صدا (از انتخاب کاربر)
202
  1.0, // 9: مدت زمان ثابت بهینه کلون
203
  true, // 10: پیش‌پردازش
204
  true, // 11: پس‌پردازش