Spaces:
Sleeping
Sleeping
Commit ·
5acf34b
1
Parent(s): 8f1f1a1
Remove Developer Toolkit section from UI
Browse files- static/app.js +3 -0
- templates/index.html +0 -100
static/app.js
CHANGED
|
@@ -512,6 +512,9 @@
|
|
| 512 |
}
|
| 513 |
|
| 514 |
function fillReadonly(node, value) {
|
|
|
|
|
|
|
|
|
|
| 515 |
node.value = value || "";
|
| 516 |
}
|
| 517 |
|
|
|
|
| 512 |
}
|
| 513 |
|
| 514 |
function fillReadonly(node, value) {
|
| 515 |
+
if (!node) {
|
| 516 |
+
return;
|
| 517 |
+
}
|
| 518 |
node.value = value || "";
|
| 519 |
}
|
| 520 |
|
templates/index.html
CHANGED
|
@@ -143,106 +143,6 @@
|
|
| 143 |
</section>
|
| 144 |
</section>
|
| 145 |
|
| 146 |
-
<section class="panel lower-panel">
|
| 147 |
-
<div class="panel-head">
|
| 148 |
-
<div>
|
| 149 |
-
<p class="panel-kicker">Developer Toolkit</p>
|
| 150 |
-
<h2>Ready-to-use API snippets</h2>
|
| 151 |
-
</div>
|
| 152 |
-
</div>
|
| 153 |
-
|
| 154 |
-
<div class="lower-grid">
|
| 155 |
-
<div>
|
| 156 |
-
<h3>Integration modes</h3>
|
| 157 |
-
<div class="guide-card">
|
| 158 |
-
<p class="guide-summary">
|
| 159 |
-
Choose the mode based on your product needs: fast URL playback with Translate or controllable MP3 generation with Edge voices.
|
| 160 |
-
</p>
|
| 161 |
-
<p class="guide-label">Translate URL mode</p>
|
| 162 |
-
<p class="guide-copy">
|
| 163 |
-
Best for quick playback where your app only needs an instantly playable URL and minimal setup complexity.
|
| 164 |
-
</p>
|
| 165 |
-
<ol class="guide-steps">
|
| 166 |
-
<li>Call <code>GET /api/translate-url</code> or <code>POST /api/synthesize</code> with <code>provider=translate</code>.</li>
|
| 167 |
-
<li>Read <code>directUrl</code> and <code>proxyUrl</code> from the response.</li>
|
| 168 |
-
<li>Set <code>proxyUrl</code> as your player source for stable inline playback.</li>
|
| 169 |
-
</ol>
|
| 170 |
-
</div>
|
| 171 |
-
|
| 172 |
-
<div class="guide-card">
|
| 173 |
-
<p class="guide-label">Edge neural mode</p>
|
| 174 |
-
<p class="guide-copy">
|
| 175 |
-
Best for voice quality and detailed control over voice, rate, volume, and pitch with reusable MP3 output.
|
| 176 |
-
</p>
|
| 177 |
-
<ol class="guide-steps">
|
| 178 |
-
<li>Call <code>GET /api/voices?filter=en-US</code> to fetch available voices.</li>
|
| 179 |
-
<li>Call <code>POST /api/synthesize</code> with <code>provider=edge</code> and selected voice parameters.</li>
|
| 180 |
-
<li>Use <code>audioUrl</code> in your player for production playback.</li>
|
| 181 |
-
</ol>
|
| 182 |
-
</div>
|
| 183 |
-
</div>
|
| 184 |
-
|
| 185 |
-
<div>
|
| 186 |
-
<h3>Copy-and-paste snippets</h3>
|
| 187 |
-
<label class="field">
|
| 188 |
-
<span>1. Base HTML audio player</span>
|
| 189 |
-
<textarea id="base-html-snippet" rows="4" readonly></textarea>
|
| 190 |
-
</label>
|
| 191 |
-
|
| 192 |
-
<label class="field">
|
| 193 |
-
<span>2. Translate: inline audio playback</span>
|
| 194 |
-
<textarea id="audio-tag-snippet" rows="6" readonly></textarea>
|
| 195 |
-
</label>
|
| 196 |
-
|
| 197 |
-
<label class="field">
|
| 198 |
-
<span>3. Translate: fetch and play</span>
|
| 199 |
-
<textarea id="fetch-get-snippet" rows="10" readonly></textarea>
|
| 200 |
-
</label>
|
| 201 |
-
|
| 202 |
-
<label class="field">
|
| 203 |
-
<span>4. Translate URL example</span>
|
| 204 |
-
<textarea id="example-get-url" rows="4" readonly></textarea>
|
| 205 |
-
</label>
|
| 206 |
-
|
| 207 |
-
<label class="field">
|
| 208 |
-
<span>5. Translate audio endpoint</span>
|
| 209 |
-
<textarea id="example-audio-url" rows="4" readonly></textarea>
|
| 210 |
-
</label>
|
| 211 |
-
|
| 212 |
-
<label class="field">
|
| 213 |
-
<span>6. Edge voices endpoint</span>
|
| 214 |
-
<textarea id="example-voices-url" rows="3" readonly></textarea>
|
| 215 |
-
</label>
|
| 216 |
-
|
| 217 |
-
<label class="field">
|
| 218 |
-
<span>7. Edge synthesize request</span>
|
| 219 |
-
<textarea id="fetch-post-snippet" rows="16" readonly></textarea>
|
| 220 |
-
</label>
|
| 221 |
-
|
| 222 |
-
<label class="field">
|
| 223 |
-
<span>8. Translate response sample</span>
|
| 224 |
-
<textarea id="translate-response-snippet" rows="10" readonly></textarea>
|
| 225 |
-
</label>
|
| 226 |
-
|
| 227 |
-
<label class="field">
|
| 228 |
-
<span>9. Edge response sample</span>
|
| 229 |
-
<textarea id="edge-response-snippet" rows="10" readonly></textarea>
|
| 230 |
-
</label>
|
| 231 |
-
|
| 232 |
-
<label class="field">
|
| 233 |
-
<span>10. End-to-end process summary</span>
|
| 234 |
-
<textarea id="process-summary" rows="10" readonly></textarea>
|
| 235 |
-
</label>
|
| 236 |
-
|
| 237 |
-
<div class="action-row">
|
| 238 |
-
<button type="button" data-copy-target="base-html-snippet">Copy HTML base</button>
|
| 239 |
-
<button type="button" data-copy-target="audio-tag-snippet" class="secondary">Copy translate audio</button>
|
| 240 |
-
<button type="button" data-copy-target="fetch-get-snippet" class="secondary">Copy translate fetch</button>
|
| 241 |
-
<button type="button" data-copy-target="fetch-post-snippet" class="secondary">Copy edge fetch</button>
|
| 242 |
-
</div>
|
| 243 |
-
</div>
|
| 244 |
-
</div>
|
| 245 |
-
</section>
|
| 246 |
</main>
|
| 247 |
|
| 248 |
<script src="/static/app.js" defer></script>
|
|
|
|
| 143 |
</section>
|
| 144 |
</section>
|
| 145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
</main>
|
| 147 |
|
| 148 |
<script src="/static/app.js" defer></script>
|