File size: 41,575 Bytes
149cc14 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>StreamAI - Dual Channel ASR with Cloudflare TURN</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@keyframes float {
0% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
100% { transform: translateY(0px); }
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.floating {
animation: float 6s ease-in-out infinite;
}
.floating-btn {
animation: float 4s ease-in-out infinite, pulse 2s ease-in-out infinite;
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}
.gradient-bg {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.chat-bubble {
border-radius: 20px;
position: relative;
max-width: 80%;
}
.user-bubble {
background-color: #4f46e5;
color: white;
margin-left: auto;
border-bottom-right-radius: 5px;
}
.ai-bubble {
background-color: #f3f4f6;
color: #1f2937;
margin-right: auto;
border-bottom-left-radius: 5px;
}
.typing-indicator span {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #9ca3af;
margin: 0 2px;
}
.typing-indicator span:nth-child(1) {
animation: bounce 1s infinite;
}
.typing-indicator span:nth-child(2) {
animation: bounce 1s infinite 0.2s;
}
.typing-indicator span:nth-child(3) {
animation: bounce 1s infinite 0.4s;
}
@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-5px); }
}
.stream-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.fade-in {
animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.notification {
position: fixed;
bottom: 20px;
right: 20px;
background: #4f46e5;
color: white;
padding: 15px 25px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transform: translateX(120%);
transition: transform 0.3s ease-out;
z-index: 1000;
}
.notification.show {
transform: translateX(0);
}
.content-stream {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
background-color: #000;
border-radius: 8px;
overflow: hidden;
}
.content-stream video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.content-stream-placeholder {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
background: linear-gradient(135deg, #434343 0%, #000000 100%);
}
.tab {
padding: 8px 16px;
border-radius: 20px;
font-size: 14px;
cursor: pointer;
margin-right: 8px;
}
.tab.active {
background-color: #4f46e5;
color: white;
}
.tab.inactive {
background-color: #f3f4f6;
color: #6b7280;
}
.api-endpoint {
background-color: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 6px;
padding: 16px;
margin-bottom: 16px;
font-family: monospace;
}
.api-method {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-weight: bold;
margin-right: 8px;
}
.api-method.get {
background-color: #ebf8ff;
color: #3182ce;
}
.api-method.post {
background-color: #ebf8f2;
color: #38a169;
}
.api-path {
color: #4a5568;
}
.api-description {
margin-top: 8px;
color: #4a5568;
}
.price-up {
color: #10b981;
}
.price-down {
color: #ef4444;
}
.price-neutral {
color: #6b7280;
}
.data-card {
transition: all 0.3s ease;
}
.data-card:hover {
transform: translateY(-3px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.sparkline {
height: 40px;
width: 100%;
position: relative;
}
.sparkline-line {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
stroke: currentColor;
fill: none;
stroke-width: 2;
}
.sparkline-area {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
fill: currentColor;
fill-opacity: 0.2;
}
.asr-transcript {
height: 200px;
overflow-y: auto;
background-color: #f3f4f6;
padding: 15px;
border-radius: 8px;
margin-top: 15px;
}
.asr-transcript p {
margin-bottom: 8px;
line-height: 1.4;
}
.mic-active {
color: #ef4444;
animation: pulse 1.5s infinite;
}
.dual-channel-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
.channel-panel {
border: 1px solid #e2e8f0;
border-radius: 8px;
padding: 15px;
background-color: white;
position: relative;
}
.channel-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #e2e8f0;
}
.channel-title {
font-weight: bold;
font-size: 18px;
}
.context-panel {
margin-top: 15px;
padding: 10px;
background-color: #f8fafc;
border-radius: 6px;
border-left: 4px solid #4f46e5;
}
.context-title {
font-weight: bold;
margin-bottom: 5px;
color: #4f46e5;
}
.context-content {
font-size: 14px;
color: #4a5568;
}
.connection-status {
position: absolute;
top: -10px;
right: -10px;
background: white;
border-radius: 50%;
padding: 5px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
z-index: 10;
}
.floating-controls {
position: fixed;
bottom: 30px;
right: 30px;
display: flex;
flex-direction: column;
gap: 15px;
z-index: 100;
}
.floating-btn {
width: 60px;
height: 60px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
}
.floating-btn:hover {
transform: scale(1.1) translateY(-5px);
}
.floating-btn i {
font-size: 24px;
}
.badge {
position: absolute;
top: -5px;
right: -5px;
background: #ef4444;
color: white;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
.arrow-up {
color: #3b82f6;
animation: float 2s ease-in-out infinite;
}
.arrow-down {
color: #10b981;
animation: float 2s ease-in-out infinite;
}
.active-transmission {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
text-align: center;
opacity: 0;
transition: opacity 0.3s ease;
}
.active-transmission.show {
opacity: 1;
}
/* Permissions Modal */
.permissions-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.permissions-modal.active {
opacity: 1;
visibility: visible;
}
.permissions-content {
background-color: white;
border-radius: 12px;
padding: 30px;
width: 90%;
max-width: 500px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
transform: translateY(20px);
transition: transform 0.3s ease;
}
.permissions-modal.active .permissions-content {
transform: translateY(0);
}
.permissions-header {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.permissions-icon {
font-size: 24px;
margin-right: 15px;
color: #4f46e5;
}
.permissions-title {
font-size: 20px;
font-weight: bold;
}
.permissions-body {
margin-bottom: 25px;
}
.permission-item {
display: flex;
align-items: center;
margin-bottom: 15px;
padding: 10px;
border-radius: 8px;
background-color: #f8fafc;
}
.permission-icon {
font-size: 20px;
margin-right: 15px;
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: #e0e7ff;
color: #4f46e5;
}
.permission-text {
flex: 1;
}
.permission-name {
font-weight: bold;
margin-bottom: 3px;
}
.permission-desc {
font-size: 14px;
color: #64748b;
}
.permission-status {
font-size: 14px;
padding: 5px 10px;
border-radius: 20px;
background-color: #e2e8f0;
color: #334155;
}
.permission-status.granted {
background-color: #d1fae5;
color: #065f46;
}
.permission-status.denied {
background-color: #fee2e2;
color: #991b1b;
}
.permissions-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
}
.permissions-btn {
padding: 10px 20px;
border-radius: 8px;
font-weight: bold;
cursor: pointer;
transition: all 0.2s ease;
}
.permissions-btn.cancel {
background-color: #f1f5f9;
color: #64748b;
}
.permissions-btn.cancel:hover {
background-color: #e2e8f0;
}
.permissions-btn.allow {
background-color: #4f46e5;
color: white;
}
.permissions-btn.allow:hover {
background-color: #4338ca;
}
@media (max-width: 768px) {
.dual-channel-container {
grid-template-columns: 1fr;
}
.floating-controls {
bottom: 20px;
right: 20px;
gap: 10px;
}
.floating-btn {
width: 50px;
height: 50px;
}
.permissions-content {
padding: 20px;
width: 95%;
}
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<!-- Permissions Modal -->
<div class="permissions-modal" id="permissionsModal">
<div class="permissions-content">
<div class="permissions-header">
<div class="permissions-icon">
<i class="fas fa-shield-alt"></i>
</div>
<div class="permissions-title">Required Permissions</div>
</div>
<div class="permissions-body">
<p class="text-gray-600 mb-4">StreamAI needs the following permissions to function properly:</p>
<div class="permission-item">
<div class="permission-icon">
<i class="fas fa-microphone"></i>
</div>
<div class="permission-text">
<div class="permission-name">Microphone Access</div>
<div class="permission-desc">Required for speech recognition and audio processing</div>
</div>
<div class="permission-status" id="micPermissionStatus">Not Granted</div>
</div>
<div class="permission-item">
<div class="permission-icon">
<i class="fas fa-wifi"></i>
</div>
<div class="permission-text">
<div class="permission-name">Network Access</div>
<div class="permission-desc">Required for connecting to ASR services and APIs</div>
</div>
<div class="permission-status granted">Granted</div>
</div>
<div class="permission-item">
<div class="permission-icon">
<i class="fas fa-camera"></i>
</div>
<div class="permission-text">
<div class="permission-name">Camera Access (Optional)</div>
<div class="permission-desc">For video streaming and face detection features</div>
</div>
<div class="permission-status" id="camPermissionStatus">Not Requested</div>
</div>
</div>
<div class="permissions-footer">
<button class="permissions-btn cancel" id="cancelPermissions">Cancel</button>
<button class="permissions-btn allow" id="allowPermissions">Allow Permissions</button>
</div>
</div>
</div>
<!-- Notification -->
<div id="notification" class="notification hidden">
<div class="flex items-center">
<i class="fas fa-bell text-yellow-300 mr-3"></i>
<div>
<p class="font-semibold" id="notification-title">Reminder Set!</p>
<p class="text-sm" id="notification-message">We'll notify you when this show is about to broadcast.</p>
</div>
</div>
</div>
<!-- Header -->
<header class="gradient-bg text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-3">
<i class="fas fa-broadcast-tower text-3xl"></i>
<h1 class="text-2xl font-bold">StreamAI Dual Channel</h1>
</div>
<nav class="hidden md:flex space-x-6">
<a href="#" class="hover:text-indigo-200 transition">Home</a>
<a href="#features" class="hover:text-indigo-200 transition">Features</a>
<a href="#asr" class="hover:text-indigo-200 transition">Dual ASR</a>
<a href="#api" class="hover:text-indigo-200 transition">API</a>
</nav>
<button class="md:hidden text-xl">
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</header>
<!-- Hero Section -->
<section class="gradient-bg text-white py-16">
<div class="container mx-auto px-4 flex flex-col md:flex-row items-center">
<div class="md:w-1/2 mb-10 md:mb-0">
<h2 class="text-4xl md:text-5xl font-bold mb-4">Dual Channel ASR System</h2>
<p class="text-xl mb-8 text-indigo-100">Real-time bidirectional speech recognition with contextual augmentation for both participants.</p>
<div class="flex space-x-4">
<button onclick="scrollToSection('asr')" class="bg-white text-indigo-600 px-6 py-3 rounded-full font-semibold hover:bg-indigo-100 transition">
Try Dual ASR
</button>
<button onclick="scrollToSection('api')" class="border-2 border-white text-white px-6 py-3 rounded-full font-semibold hover:bg-white hover:text-indigo-600 transition">
API Docs
</button>
</div>
</div>
<div class="md:w-1/2 flex justify-center">
<div class="relative w-64 h-64 md:w-80 md:h-80">
<div class="absolute inset-0 bg-indigo-500 rounded-full opacity-20 floating"></div>
<div class="absolute inset-4 bg-indigo-400 rounded-full opacity-30 floating" style="animation-delay: 0.5s;"></div>
<div class="absolute inset-8 bg-indigo-300 rounded-full opacity-40 floating" style="animation-delay: 1s;"></div>
<div class="absolute inset-12 bg-white rounded-full flex items-center justify-center">
<div class="text-center p-6">
<i class="fas fa-exchange-alt text-indigo-600 text-4xl mb-3"></i>
<h3 class="text-xl font-bold text-gray-800">Dual Channel</h3>
<p class="text-gray-600">Simultaneous ASR</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Features Section -->
<section id="features" class="py-16 bg-white">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12">Key Features</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="bg-gray-50 p-6 rounded-xl shadow-md hover:shadow-lg transition data-card">
<div class="text-indigo-600 mb-4">
<i class="fas fa-microphone-alt text-4xl"></i>
</div>
<h3 class="text-xl font-bold mb-2">Real-time ASR</h3>
<p class="text-gray-600">Accurate speech recognition with low latency for natural conversations.</p>
</div>
<div class="bg-gray-50 p-6 rounded-xl shadow-md hover:shadow-lg transition data-card">
<div class="text-indigo-600 mb-4">
<i class="fas fa-random text-4xl"></i>
</div>
<h3 class="text-xl font-bold mb-2">Dual Channel</h3>
<p class="text-gray-600">Independent processing of both participants' audio streams.</p>
</div>
<div class="bg-gray-50 p-6 rounded-xl shadow-md hover:shadow-lg transition data-card">
<div class="text-indigo-600 mb-4">
<i class="fas fa-brain text-4xl"></i>
</div>
<h3 class="text-xl font-bold mb-2">Contextual AI</h3>
<p class="text-gray-600">Smart augmentation based on conversation context and subject matter.</p>
</div>
</div>
</div>
</section>
<!-- Dual ASR Section -->
<section id="asr" class="py-16 bg-gray-100">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12">Dual Channel ASR</h2>
<div class="dual-channel-container">
<!-- Channel 1 - Sender -->
<div class="channel-panel">
<div class="connection-status">
<i class="fas fa-wifi text-green-500"></i>
</div>
<div class="channel-header">
<div class="channel-title">Sender Channel</div>
<div class="flex items-center">
<span class="text-sm text-gray-500 mr-2">Model:</span>
<select class="text-sm border rounded px-2 py-1">
<option>Standard ASR</option>
<option>Technical</option>
<option>Medical</option>
<option>Legal</option>
<option>Casual</option>
</select>
</div>
</div>
<div class="content-stream">
<div class="content-stream-placeholder">
<i class="fas fa-user text-4xl mb-2"></i>
<p>Sender Audio Stream</p>
</div>
</div>
<div class="asr-transcript">
<p><span class="font-semibold">System:</span> Sender channel ready for speech input</p>
</div>
<div class="context-panel">
<div class="context-title">Context Analysis</div>
<div class="context-content">Waiting for speech input to analyze context...</div>
</div>
<div class="active-transmission" id="sender-transmission">
<i class="fas fa-arrow-up arrow-up text-4xl mb-1"></i>
<p class="text-sm font-semibold text-blue-500">Transmitting</p>
</div>
</div>
<!-- Channel 2 - Receiver -->
<div class="channel-panel">
<div class="connection-status">
<i class="fas fa-wifi text-green-500"></i>
</div>
<div class="channel-header">
<div class="channel-title">Receiver Channel</div>
<div class="flex items-center">
<span class="text-sm text-gray-500 mr-2">Model:</span>
<select class="text-sm border rounded px-2 py-1">
<option>Standard ASR</option>
<option>Technical</option>
<option>Medical</option>
<option>Legal</option>
<option>Casual</option>
</select>
</div>
</div>
<div class="content-stream">
<div class="content-stream-placeholder">
<i class="fas fa-user text-4xl mb-2"></i>
<p>Receiver Audio Stream</p>
</div>
</div>
<div class="asr-transcript">
<p><span class="font-semibold">System:</span> Receiver channel ready for speech input</p>
</div>
<div class="context-panel">
<div class="context-title">Context Analysis</div>
<div class="context-content">Waiting for speech input to analyze context...</div>
</div>
<div class="active-transmission" id="receiver-transmission">
<i class="fas fa-arrow-down arrow-down text-4xl mb-1"></i>
<p class="text-sm font-semibold text-green-500">Receiving</p>
</div>
</div>
</div>
</div>
</section>
<!-- Floating Controls -->
<div class="floating-controls">
<div class="floating-btn bg-indigo-600 text-white" id="mic-btn" onclick="requestMicPermission()">
<i class="fas fa-microphone"></i>
<div class="badge hidden">1</div>
</div>
<div class="floating-btn bg-green-500 text-white" id="connect-btn" onclick="toggleConnection()">
<i class="fas fa-plug"></i>
</div>
<div class="floating-btn bg-blue-500 text-white" onclick="showNotification('Info', 'Dual channel ASR is active')">
<i class="fas fa-info-circle"></i>
</div>
<div class="floating-btn bg-purple-500 text-white" onclick="toggleModels()">
<i class="fas fa-cog"></i>
</div>
</div>
<!-- API Section -->
<section id="api" class="py-16 bg-white">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12">API Documentation</h2>
<div class="mb-8">
<h3 class="text-xl font-bold mb-4">Base URL</h3>
<div class="api-endpoint">
<div class="flex items-center">
<span class="api-method get">GET</span>
<span class="api-path">https://api.streamai.com/v1/asr</span>
</div>
<div class="api-description">
All API requests must be made to this base URL with the appropriate endpoint.
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div>
<h3 class="text-xl font-bold mb-4">Authentication</h3>
<div class="api-endpoint">
<div class="flex items-center">
<span class="api-method post">POST</span>
<span class="api-path">/auth</span>
</div>
<div class="api-description">
Authenticate with your API key to receive a JWT token for subsequent requests.
</div>
</div>
</div>
<div>
<h3 class="text-xl font-bold mb-4">Dual Channel ASR</h3>
<div class="api-endpoint">
<div class="flex items-center">
<span class="api-method post">POST</span>
<span class="api-path">/dual-asr</span>
</div>
<div class="api-description">
Initialize a dual channel ASR session with specified models for each channel.
</div>
</div>
</div>
<div>
<h3 class="text-xl font-bold mb-4">Stream Audio</h3>
<div class="api-endpoint">
<div class="flex items-center">
<span class="api-method post">POST</span>
<span class="api-path">/stream</span>
</div>
<div class="api-description">
Stream audio data to the specified channel in an active ASR session.
</div>
</div>
</div>
<div>
<h3 class="text-xl font-bold mb-4">Get Transcript</h3>
<div class="api-endpoint">
<div class="flex items-center">
<span class="api-method get">GET</span>
<span class="api-path">/transcript</span>
</div>
<div class="api-description">
Retrieve the current transcript for a specified channel.
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-gray-900 text-white py-8">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<div class="flex items-center space-x-2">
<i class="fas fa-broadcast-tower text-2xl"></i>
<span class="text-xl font-bold">StreamAI</span>
</div>
<p class="text-gray-400 mt-2">Advanced speech recognition for modern applications.</p>
</div>
<div class="flex space-x-6">
<a href="#" class="hover:text-indigo-300 transition"><i class="fab fa-twitter"></i></a>
<a href="#" class="hover:text-indigo-300 transition"><i class="fab fa-github"></i></a>
<a href="#" class="hover:text-indigo-300 transition"><i class="fab fa-linkedin"></i></a>
<a href="#" class="hover:text-indigo-300 transition"><i class="fab fa-discord"></i></a>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
<p>© 2023 StreamAI. All rights reserved.</p>
</div>
</div>
</footer>
<script>
// Show permissions modal on page load
document.addEventListener('DOMContentLoaded', function() {
setTimeout(() => {
document.getElementById('permissionsModal').classList.add('active');
}, 1000);
});
// Permission handling
let micPermissionGranted = false;
let camPermissionGranted = false;
// Request microphone permission
function requestMicPermission() {
if (!micPermissionGranted) {
document.getElementById('permissionsModal').classList.add('active');
return;
}
toggleMic();
}
// Handle permissions modal buttons
document.getElementById('cancelPermissions').addEventListener('click', function() {
document.getElementById('permissionsModal').classList.remove('active');
showNotification('Permissions', 'Microphone access is required for ASR functionality');
});
document.getElementById('allowPermissions').addEventListener('click', async function() {
try {
// Request microphone permission
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
micPermissionGranted = true;
document.getElementById('micPermissionStatus').textContent = 'Granted';
document.getElementById('micPermissionStatus').classList.add('granted');
// Stop the stream immediately since we just needed permission
stream.getTracks().forEach(track => track.stop());
// Update UI
showNotification('Permissions', 'Microphone access granted');
document.getElementById('permissionsModal').classList.remove('active');
// Enable microphone button
document.getElementById('mic-btn').onclick = toggleMic;
} catch (error) {
console.error('Error getting microphone permission:', error);
document.getElementById('micPermissionStatus').textContent = 'Denied';
document.getElementById('micPermissionStatus').classList.add('denied');
showNotification('Permissions', 'Microphone access was denied');
}
});
// Scroll to section
function scrollToSection(sectionId) {
document.getElementById(sectionId).scrollIntoView({ behavior: 'smooth' });
}
// Show notification
function showNotification(title, message) {
const notification = document.getElementById('notification');
const notificationTitle = document.getElementById('notification-title');
const notificationMessage = document.getElementById('notification-message');
notificationTitle.textContent = title;
notificationMessage.textContent = message;
notification.classList.remove('hidden');
notification.classList.add('show');
setTimeout(() => {
notification.classList.remove('show');
setTimeout(() => notification.classList.add('hidden'), 300);
}, 3000);
}
// Toggle microphone
let micActive = false;
function toggleMic() {
if (!micPermissionGranted) {
requestMicPermission();
return;
}
const micBtn = document.getElementById('mic-btn');
const badge = micBtn.querySelector('.badge');
const senderTransmission = document.getElementById('sender-transmission');
const receiverTransmission = document.getElementById('receiver-transmission');
micActive = !micActive;
if (micActive) {
micBtn.innerHTML = '<i class="fas fa-microphone-slash"></i>';
micBtn.classList.add('mic-active');
badge.classList.remove('hidden');
// Simulate transmission
senderTransmission.classList.add('show');
setTimeout(() => {
receiverTransmission.classList.add('show');
updateTranscripts();
}, 1000);
showNotification('Microphone', 'Microphone activated - transmitting audio');
} else {
micBtn.innerHTML = '<i class="fas fa-microphone"></i><div class="badge hidden">1</div>';
micBtn.classList.remove('mic-active');
senderTransmission.classList.remove('show');
receiverTransmission.classList.remove('show');
showNotification('Microphone', 'Microphone deactivated');
}
}
// Toggle connection
let connected = true;
function toggleConnection() {
const connectBtn = document.getElementById('connect-btn');
const wifiIcons = document.querySelectorAll('.connection-status i');
connected = !connected;
if (connected) {
connectBtn.innerHTML = '<i class="fas fa-plug"></i>';
connectBtn.classList.remove('bg-red-500');
connectBtn.classList.add('bg-green-500');
wifiIcons.forEach(icon => {
icon.classList.remove('text-red-500');
icon.classList.add('text-green-500');
});
showNotification('Connection', 'Connection established');
} else {
connectBtn.innerHTML = '<i class="fas fa-plug"></i>';
connectBtn.classList.remove('bg-green-500');
connectBtn.classList.add('bg-red-500');
wifiIcons.forEach(icon => {
icon.classList.remove('text-green-500');
icon.classList.add('text-red-500');
});
showNotification('Connection', 'Connection lost');
}
}
// Toggle models panel
function toggleModels() {
showNotification('Models', 'Available models: Standard, Technical, Medical, Legal, Casual');
}
// Update transcripts with sample data
function updateTranscripts() {
const senderTranscript = document.querySelector('.channel-panel:first-child .asr-transcript');
const receiverTranscript = document.querySelector('.channel-panel:last-child .asr-transcript');
const senderContext = document.querySelector('.channel-panel:first-child .context-content');
const receiverContext = document.querySelector('.channel-panel:last-child .context-content');
const sampleSenderText = "I'm experiencing issues with the quantum flux capacitor in our prototype. The readings are unstable when we exceed 1.21 gigawatts.";
const sampleReceiverText = "Have you checked the temporal displacement field stabilizers? They often cause fluctuations at higher energy levels.";
const senderContextText = "Technical conversation about quantum physics device troubleshooting. Technical jargon detected: 'quantum flux capacitor', 'gigawatts'.";
const receiverContextText = "Technical response suggesting solution. Contains technical terms: 'temporal displacement field stabilizers', 'energy levels'.";
// Add typing indicator
const typingIndicator = '<div class="typing-indicator"><span></span><span></span><span></span></div>';
senderTranscript.innerHTML += typingIndicator;
receiverTranscript.innerHTML += typingIndicator;
// Simulate processing delay
setTimeout(() => {
senderTranscript.querySelector('.typing-indicator').remove();
receiverTranscript.querySelector('.typing-indicator').remove();
senderTranscript.innerHTML += `<p><span class="font-semibold">You:</span> ${sampleSenderText}</p>`;
receiverTranscript.innerHTML += `<p><span class="font-semibold">AI:</span> ${sampleReceiverText}</p>`;
senderContext.textContent = senderContextText;
receiverContext.textContent = receiverContextText;
// Scroll to bottom
senderTranscript.scrollTop = senderTranscript.scrollHeight;
receiverTranscript.scrollTop = receiverTranscript.scrollHeight;
}, 2000);
}
// Mobile menu toggle
document.querySelector('.md\\:hidden').addEventListener('click', function() {
const nav = document.querySelector('nav');
if (nav.classList.contains('hidden')) {
nav.classList.remove('hidden');
nav.classList.add('flex', 'flex-col', 'absolute', 'top-16', 'right-4', 'bg-indigo-700', 'p-4', 'rounded-lg', 'z-50');
} else {
nav.classList.add('hidden');
nav.classList.remove('flex', 'flex-col', 'absolute', 'top-16', 'right-4', 'bg-indigo-700', 'p-4', 'rounded-lg', 'z-50');
}
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=privateuserh/privaistrm-vbeta1-08" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |