mirror of
https://github.com/QuentinFuxa/WhisperLiveKit.git
synced 2026-03-07 22:33:36 +00:00
/ws to /asr to distinguish protocol ws:// from endpoint
This commit is contained in:
@@ -86,7 +86,7 @@ This project reuses and extends code from the original Whisper Streaming reposit
|
||||
### 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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -57,7 +57,7 @@ async def start_ffmpeg_decoder():
|
||||
)
|
||||
return process
|
||||
|
||||
@app.websocket("/ws")
|
||||
@app.websocket("/asr")
|
||||
async def websocket_endpoint(websocket: WebSocket):
|
||||
await websocket.accept()
|
||||
print("WebSocket connection opened.")
|
||||
|
||||
Reference in New Issue
Block a user