|
<!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%; |
|
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 { |
|
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"> |
|
|
|
<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> |
|
|
|
|
|
<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 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> |
|
|
|
|
|
<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> |
|
|
|
|
|
<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> |
|
|
|
|
|
<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"> |
|
|
|
<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> |
|
|
|
|
|
<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> |
|
|
|
|
|
<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> |
|
|
|
|
|
<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 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> |
|
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
setTimeout(() => { |
|
document.getElementById('permissionsModal').classList.add('active'); |
|
}, 1000); |
|
}); |
|
|
|
|
|
let micPermissionGranted = false; |
|
let camPermissionGranted = false; |
|
|
|
|
|
function requestMicPermission() { |
|
if (!micPermissionGranted) { |
|
document.getElementById('permissionsModal').classList.add('active'); |
|
return; |
|
} |
|
|
|
toggleMic(); |
|
} |
|
|
|
|
|
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 { |
|
|
|
const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); |
|
micPermissionGranted = true; |
|
document.getElementById('micPermissionStatus').textContent = 'Granted'; |
|
document.getElementById('micPermissionStatus').classList.add('granted'); |
|
|
|
|
|
stream.getTracks().forEach(track => track.stop()); |
|
|
|
|
|
showNotification('Permissions', 'Microphone access granted'); |
|
document.getElementById('permissionsModal').classList.remove('active'); |
|
|
|
|
|
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'); |
|
} |
|
}); |
|
|
|
|
|
function scrollToSection(sectionId) { |
|
document.getElementById(sectionId).scrollIntoView({ behavior: 'smooth' }); |
|
} |
|
|
|
|
|
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); |
|
} |
|
|
|
|
|
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'); |
|
|
|
|
|
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'); |
|
} |
|
} |
|
|
|
|
|
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'); |
|
} |
|
} |
|
|
|
|
|
function toggleModels() { |
|
showNotification('Models', 'Available models: Standard, Technical, Medical, Legal, Casual'); |
|
} |
|
|
|
|
|
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'."; |
|
|
|
|
|
const typingIndicator = '<div class="typing-indicator"><span></span><span></span><span></span></div>'; |
|
senderTranscript.innerHTML += typingIndicator; |
|
receiverTranscript.innerHTML += typingIndicator; |
|
|
|
|
|
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; |
|
|
|
|
|
senderTranscript.scrollTop = senderTranscript.scrollHeight; |
|
receiverTranscript.scrollTop = receiverTranscript.scrollHeight; |
|
}, 2000); |
|
} |
|
|
|
|
|
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> |