Quentin Fuxa 2024-12-25
/ws to /asr to distinguish protocol ws:// from endpoint
@4de8651f1af5c4ec909aac03230620b8da90c167
README.md
--- README.md
+++ README.md
@@ -86,7 +86,7 @@
 ### How the Live Interface Works
 
 - Once you **allow microphone access**, the page records small chunks of audio using the **MediaRecorder** API in **webm/opus** format.  
-- These chunks are sent over a **WebSocket** to the FastAPI endpoint at `/ws`.  
+- These chunks are sent over a **WebSocket** to the FastAPI endpoint at `/asr`.  
 - The Python server decodes `.webm` chunks on the fly using **FFmpeg** and streams them into the **whisper streaming** implementation for transcription.  
 - **Partial transcription** appears as soon as enough audio is processed. The “unvalidated” text is shown in **lighter or grey color** (i.e., an ‘aperçu’) to indicate it’s still buffered partial output. Once Whisper finalizes that segment, it’s displayed in normal text.  
 - You can watch the transcription update in near real time, ideal for demos, prototyping, or quick debugging.
src/live_transcription.html
--- src/live_transcription.html
+++ src/live_transcription.html
@@ -92,7 +92,7 @@
       </div>
       <div>
         <label for="websocketInput">WebSocket URL:</label>
-        <input id="websocketInput" type="text" value="ws://localhost:8000/ws" />
+        <input id="websocketInput" type="text" value="ws://localhost:8000/asr" />
       </div>
     </div>
   </div>
@@ -105,7 +105,7 @@
       websocket,
       recorder,
       chunkDuration = 1000,
-      websocketUrl = "ws://localhost:8000/ws";
+      websocketUrl = "ws://localhost:8000/asr";
 
     // Tracks whether the user voluntarily closed the WebSocket
     let userClosing = false;
whisper_fastapi_online_server.py
--- whisper_fastapi_online_server.py
+++ whisper_fastapi_online_server.py
@@ -57,7 +57,7 @@
     )
     return process
 
-@app.websocket("/ws")
+@app.websocket("/asr")
 async def websocket_endpoint(websocket: WebSocket):
     await websocket.accept()
     print("WebSocket connection opened.")
Add a comment
List