{"id":53745,"date":"2025-02-16T08:29:54","date_gmt":"2025-02-16T00:29:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53745\/"},"modified":"2025-02-16T08:29:54","modified_gmt":"2025-02-16T00:29:54","slug":"whisperflow%e5%ae%9e%e6%97%b6%e9%9f%b3%e9%a2%91%e8%bd%ac%e5%bd%95%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53745\/","title":{"rendered":"WhisperFlow\u5b9e\u65f6\u97f3\u9891\u8f6c\u5f55\u5e93"},"content":{"rendered":"<p>\u5982\u4eca\uff0c\u5b9e\u65f6\u8f6c\u5f55\u5bf9\u4e8e\u5728\u5ba2\u6237\u652f\u6301\u3001\u73b0\u573a\u6d3b\u52a8\u548c\u865a\u62df\u901a\u4fe1\u4e2d\u63d0\u4f9b\u5373\u65f6\u53cd\u9988\u81f3\u5173\u91cd\u8981\u3002\u5b83\u589e\u5f3a\u4e86\u53ef\u8bbf\u95ee\u6027\uff0c\u786e\u4fdd\u4e86\u542c\u529b\u969c\u788d\u4eba\u58eb\u7684\u5305\u5bb9\u6027\uff0c\u5e76\u6539\u5584\u4e86\u6574\u4f53\u7528\u6237\u4f53\u9a8c\u3002\u5e76\u652f\u6301\u4f9d\u8d56\u5b9e\u65f6\u6570\u636e\u7684\u884c\u4e1a\u7684\u5feb\u901f\u51b3\u7b56\u3001\u6cd5\u89c4\u9075\u4ece\u6027\u548c\u65e0\u7f1d\u7684\u5168\u7403\u534f\u4f5c\u3002<\/p>\n<p>\u662f\u4e00\u79cd\u7531 OpenAI \u7684 Whisper \u6a21\u578b\u63d0\u4f9b\u652f\u6301\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u65e8\u5728\u5c06\u4f20\u7edf\u7684\u6279\u5904\u7406\u8f6c\u53d8\u4e3a\u5b9e\u65f6\u97f3\u9891\u8f6c\u5f55\uff0c\u786e\u4fdd\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u51c6\u786e\u6027\u3002<\/p>\n<h2>1\u3001\u4e0d\u91cd\u65b0\u53d1\u660e\u8f6e\u5b50<\/h2>\n<p>WhisperFlow \u5de7\u5999\u5730\u5efa\u7acb\u5728 OpenAI \u7684 Whisper \u6846\u67b6\u548c\u6a21\u578b\u4e4b\u4e0a\uff0c\u5b83\u901a\u8fc7\u6dfb\u52a0\u5b9e\u65f6\u529f\u80fd\u6269\u5c55\u4e86 OpenAI Whisper\u3002WhisperFlow \u91c7\u7528\u4e86 Whisper \u6700\u5148\u8fdb\u7684\u51c6\u786e\u6027\uff0c\u5e76\u8fdb\u4e00\u6b65\u5b8c\u5584\uff0c\u4f7f\u5176\u5728\u4e0d\u540c\u60c5\u51b5\u4e0b\u66f4\u6709\u7528\uff0c\u5c24\u5176\u662f\u5b9e\u65f6\u5904\u7406\u3002<\/p>\n<p> Whisper \u6a21\u578b <\/p>\n<h2>2\u3001\u4ece\u6279\u5904\u7406\u5230\u5b9e\u65f6<\/h2>\n<p>Whisper \u6846\u67b6\u4e13\u4e3a\u6279\u5904\u7406\u800c\u6784\u5efa\uff0c\u53ef\u4e00\u6b21\u8f6c\u5f55\u6574\u4e2a\u97f3\u9891\u6587\u4ef6\u3002\u5c3d\u7ba1\u6548\u679c\u663e\u8457\uff0c\u4f46\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u901a\u5e38\u9700\u8981\u5b9e\u65f6\u53cd\u9988\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u5b9e\u65f6\u4f1a\u8bae\u8f6c\u5f55\u3001\u8bed\u97f3\u52a9\u624b\u6216\u5b9e\u65f6\u64ad\u5ba2\u5b57\u5e55\u7b49\u7528\u4f8b\u3002WhisperFlow \u901a\u8fc7\u6dfb\u52a0\u5b9e\u65f6\u5904\u7406\u529f\u80fd\u589e\u5f3a\u4e86 Whisper \u7684\u529f\u80fd\uff0c\u5141\u8bb8\u5728\u7528\u6237\u4ecd\u5728\u8bb2\u8bdd\u65f6\u8f6c\u5f55\u5b9e\u65f6\u97f3\u9891\u6d41\u3002WhisperFlow \u5229\u7528 WebSockets \u8fdb\u884c\u5b9e\u65f6\u97f3\u9891\u6d41\u4f20\u8f93\uff0c\u4ee5\u4e9a\u79d2\u7ea7\u5ef6\u8fdf\u5904\u7406\u5c0f\u5757\u97f3\u9891\u3002\u5b83\u4f7f\u7528\u6eda\u52a8\u7a97\u53e3\u6280\u672f\uff0c\u6839\u636e\u6682\u505c\u5bf9\u97f3\u9891\u8fdb\u884c\u5206\u6bb5\uff0c\u4ee5\u63d0\u4f9b\u5373\u65f6\u7684\u90e8\u5206\u7ed3\u679c\uff0c\u5e76\u5728\u83b7\u5f97\u66f4\u591a\u4e0a\u4e0b\u6587\u65f6\u63d0\u9ad8\u51c6\u786e\u6027\u3002<\/p>\n<p> \u97f3\u9891\u5757\u548c\u6eda\u52a8\u7a97\u53e3 <\/p>\n<p>\u97f3\u9891\u5757\u5b9e\u65f6\u8f6c\u5f55\uff0c\u968f\u7740\u65b0\u5757\u7684\u5230\u6765\u548c\u66f4\u591a\u4e0a\u4e0b\u6587\u7684\u6dfb\u52a0\uff0c\u90e8\u5206\u7ed3\u679c\u5f97\u5230\u6539\u8fdb\u3002\u6682\u505c\u5c06\u7ed3\u679c\u6807\u8bb0\u4e3a\u6700\u7ec8\u7ed3\u679c\uff0c\u786e\u4fdd\u5feb\u901f\u51c6\u786e\u5730\u8f6c\u5f55\u52a8\u6001\u97f3\u9891\u6216\u89c6\u9891\u3002\u8981\u76f4\u89c2\u5730\u4e86\u89e3\u8fd9\u4e00\u70b9\uff0c\u8bf7\u53c2\u9605\u4e0b\u9762\u7684\u90e8\u5206\u7ed3\u679c\u8868\u3002<\/p>\n<p> \u90e8\u5206\u7ed3\u679c\u548c\u6700\u7ec8\u7ed3\u679c <\/p>\n<h2>3\u3001\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u7cbe\u5ea6<\/h2>\n<p>\u8f6c\u5f55\u901f\u5ea6\u81f3\u5173\u91cd\u8981\uff0cWhisperFlow \u4ee5\u4ee4\u4eba\u5370\u8c61\u6df1\u523b\u7684\u5ef6\u8fdf\u8131\u9896\u800c\u51fa\u3002\u5728 Apple M1 \u82af\u7247\u4e0a\uff0cWhisperFlow &nbsp; \u7684\u5e73\u5747\u5ef6\u8fdf\u4e3a 275.22 \u6beb\u79d2\u2014\u2014\u5373\u4f7f\u5bf9\u4e8e\u5b9e\u65f6\u5e94\u7528\u7a0b\u5e8f\u6765\u8bf4\u4e5f\u975e\u5e38\u4f4e\u3002\u5728 GPU \u673a\u5668\u4e0a\uff0c\u6027\u80fd\u8fdb\u4e00\u6b65\u63d0\u9ad8\uff0c\u8d85\u8d8a\u4e86\u4ec5 CPU \u7684\u57fa\u51c6\uff0c\u4ece\u800c\u80fd\u591f\u66f4\u5feb\u5730\u5904\u7406\u5927\u578b\u4efb\u52a1\u3002WhisperFlow \u53ef\u786e\u4fdd\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u9ad8\u6548\u5feb\u901f\u5730\u8fd0\u884c\uff0c\u800c\u4e0d\u4f1a\u5f71\u54cd\u51c6\u786e\u6027\u3002<\/p>\n<h2>4\u3001\u8f7b\u677e\u4e0e Python \u548c FastAPI \u96c6\u6210<\/h2>\n<p>WhisperFlow \u4e0d\u4f1a\u4f7f\u5f00\u53d1\u4eba\u5458\u7684\u751f\u6d3b\u53d8\u5f97\u590d\u6742\u3002\u5b83\u7684\u6253\u5305\u65b9\u5f0f\u4f7f\u96c6\u6210\u5230\u73b0\u6709 Python \u9879\u76ee\u4e2d\u53d8\u5f97\u7b80\u5355\u3002\u4f60\u53ef\u4ee5\u5c06\u5176\u7528\u4f5c\u7b80\u5355\u7684 Python \u5e93\uff0c\u5728\u81ea\u5df1\u7684\u4ee3\u7801\u4e2d\u8c03\u7528\u5b83\uff0c\u6216\u8005\u5c06\u5176\u90e8\u7f72\u4e3a\u72ec\u7acb\u7684 FastAPI \u670d\u52a1\u5668\u4ee5\u7528\u4e8e\u66f4\u5e7f\u6cdb\u7684\u7528\u4f8b\u3002\u5176\u7075\u6d3b\u7684\u67b6\u6784\u4f7f\u5176\u975e\u5e38\u9002\u5408\u5c0f\u578b\u811a\u672c\u548c\u66f4\u5927\u7684\u5206\u5e03\u5f0f\u7cfb\u7edf\u3002<\/p>\n<p>\u8981\u5c06 WhisperFlow \u4f5c\u4e3a Web \u670d\u52a1\u5668\u8fd0\u884c\uff0c\u8bf7\u5148\u5c06\u5b58\u50a8\u5e93\u514b\u9686\u5230\u672c\u5730\u8ba1\u7b97\u673a\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/dimastatz\/whisper-flow.git<\/code><\/pre>\n<p>\u7136\u540e\u5bfc\u822a\u5230 WhisperFlow \u6587\u4ef6\u5939\uff0c\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u6240\u6709\u4f9d\u8d56\u9879\u7684\u672c\u5730 <code>venv<\/code>\uff0c\u5e76\u5728\u7aef\u53e3 8181 \u4e0a\u8fd0\u884c Web \u670d\u52a1\u5668\uff1a<\/p>\n<pre><code>cd whisper-flow\n.\/run.sh -local\nsource .venv\/bin\/activate\n.\/run.sh -benchmark<\/code><\/pre>\n<p>\u8981\u5c06 WhisperFlow \u96c6\u6210\u5230\u4f60\u7684 Python \u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u8bf7\u5148\u5b89\u88c5 whisper python \u5305\uff1a<\/p>\n<pre><code>pip install whisperflow<\/code><\/pre>\n<p>\u7136\u540e\u5bfc\u5165 WhsiperFlow \u548c transcriber \u6a21\u5757\uff1a<\/p>\n<pre><code>import whisperflow.streaming as st\nimport whisperflow.transcriber as ts\n\n@app.websocket(\"\/ws\")\nasync def websocket_endpoint(websocket: WebSocket):\n    model = ts.get_model()\n\n    async def transcribe_async(chunks: list):\n        return await ts.transcribe_pcm_chunks_async(model, chunks)\n\n    async def send_back_async(data: dict):\n        await websocket.send_json(data)\n\n    try:\n        await websocket.accept()\n        session = st.TrancribeSession(transcribe_async, send_back_async)\n\n        while True:\n            data = await websocket.receive_bytes()\n            session.add_chunk(data)\n    except Exception as exception:\n        await session.stop()\n        await websocket.close()<\/code><\/pre>\n<h2>5\u3001\u7ed3\u675f\u8bed<\/h2>\n<p>WhisperFlow \u5f25\u8865\u4e86\u6279\u91cf\u8f6c\u5f55\u548c\u5b9e\u65f6\u8f6c\u5f55\u4e4b\u95f4\u7684\u5dee\u8ddd\uff0c\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e86 Whisper \u6a21\u578b\u7684\u5f3a\u5927\u529f\u80fd\u548c\u9644\u52a0\u529f\u80fd\u3002\u65e0\u8bba\u4f60\u662f\u5728\u5bfb\u627e\u4f4e\u5ef6\u8fdf\u6027\u80fd\u3001\u8f7b\u677e\u96c6\u6210\u8fd8\u662f\u5b9e\u65f6\u5e94\u7528\u7a0b\u5e8f\u7684\u5b9e\u65f6\u8f6c\u5f55\uff0cWhisperFlow \u90fd\u80fd\u6ee1\u8db3\u60a8\u7684\u9700\u6c42\u3002\u8fd9\u662f\u4e00\u6b3e\u9762\u5411\u672a\u6765\u7684\u5de5\u5177\uff0c\u5e0c\u671b\u5b83\u6210\u4e3a\u4f60\u7684\u5de5\u5177\u5305\u4e2d\u7684\u4e00\u5458\u3002<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4eca\uff0c\u5b9e\u65f6\u8f6c\u5f55\u5bf9\u4e8e\u5728\u5ba2\u6237\u652f\u6301\u3001\u73b0\u573a\u6d3b\u52a8\u548c\u865a\u62df\u901a\u4fe1\u4e2d\u63d0\u4f9b\u5373\u65f6\u53cd\u9988\u81f3\u5173\u91cd\u8981\u3002\u5b83\u589e\u5f3a\u4e86\u53ef\u8bbf\u95ee\u6027\uff0c\u786e\u4fdd\u4e86\u542c\u529b\u969c\u788d\u4eba\u58eb\u7684\u5305\u5bb9\u6027\uff0c\u5e76\u6539\u5584\u4e86\u6574\u4f53\u7528\u6237\u4f53\u9a8c\u3002\u5e76\u652f\u6301\u4f9d\u8d56\u5b9e\u65f6\u6570\u636e\u7684\u884c\u4e1a\u7684\u5feb\u901f\u51b3\u7b56\u3001\u6cd5\u89c4\u9075\u4ece\u6027\u548c\u65e0\u7f1d\u7684\u5168\u7403\u534f\u4f5c\u3002 \u662f\u4e00\u79cd\u7531 OpenAI \u7684 Whisper \u6a21\u578b\u63d0\u4f9b\u652f\u6301\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u65e8\u5728\u5c06\u4f20\u7edf\u7684\u6279\u5904\u7406\u8f6c\u53d8\u4e3a\u5b9e\u65f6\u97f3\u9891\u8f6c\u5f55\uff0c\u786e\u4fdd\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u51c6\u786e\u6027\u3002 1\u3001\u4e0d\u91cd\u65b0\u53d1\u660e\u8f6e\u5b50 WhisperFlow \u5de7\u5999\u5730\u5efa\u7acb\u5728 OpenAI \u7684 Whisper \u6846\u67b6\u548c\u6a21\u578b\u4e4b\u4e0a\uff0c\u5b83\u901a\u8fc7\u6dfb\u52a0\u5b9e\u65f6\u529f\u80fd\u6269\u5c55\u4e86 OpenAI Whisper\u3002WhisperFlow \u91c7\u7528\u4e86 Whisper \u6700\u5148\u8fdb\u7684\u51c6\u786e\u6027\uff0c\u5e76\u8fdb\u4e00\u6b65\u5b8c\u5584\uff0c\u4f7f\u5176\u5728\u4e0d\u540c\u60c5\u51b5\u4e0b\u66f4\u6709\u7528\uff0c\u5c24\u5176\u662f\u5b9e\u65f6\u5904\u7406\u3002 Whisper \u6a21\u578b 2\u3001\u4ece\u6279\u5904\u7406\u5230\u5b9e\u65f6 Whisper \u6846\u67b6\u4e13\u4e3a\u6279\u5904\u7406\u800c\u6784\u5efa\uff0c\u53ef\u4e00\u6b21\u8f6c\u5f55\u6574\u4e2a\u97f3\u9891\u6587\u4ef6\u3002\u5c3d\u7ba1\u6548\u679c\u663e\u8457\uff0c\u4f46\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u901a\u5e38\u9700\u8981\u5b9e\u65f6\u53cd\u9988\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u5b9e\u65f6\u4f1a\u8bae\u8f6c\u5f55\u3001\u8bed\u97f3\u52a9\u624b\u6216\u5b9e\u65f6\u64ad\u5ba2\u5b57\u5e55\u7b49\u7528\u4f8b\u3002WhisperFlow \u901a\u8fc7\u6dfb\u52a0\u5b9e\u65f6\u5904\u7406\u529f\u80fd\u589e\u5f3a\u4e86 Whisper \u7684\u529f\u80fd\uff0c\u5141\u8bb8\u5728\u7528\u6237\u4ecd\u5728\u8bb2\u8bdd\u65f6\u8f6c\u5f55\u5b9e\u65f6\u97f3\u9891\u6d41\u3002WhisperFlow \u5229\u7528 WebSockets \u8fdb\u884c\u5b9e\u65f6\u97f3\u9891\u6d41\u4f20\u8f93\uff0c\u4ee5\u4e9a\u79d2\u7ea7\u5ef6\u8fdf\u5904\u7406\u5c0f\u5757\u97f3\u9891\u3002\u5b83\u4f7f\u7528\u6eda\u52a8\u7a97\u53e3\u6280\u672f\uff0c\u6839\u636e\u6682\u505c\u5bf9\u97f3\u9891\u8fdb\u884c\u5206\u6bb5\uff0c\u4ee5\u63d0\u4f9b\u5373\u65f6\u7684\u90e8\u5206\u7ed3\u679c\uff0c\u5e76\u5728\u83b7\u5f97\u66f4\u591a\u4e0a\u4e0b\u6587\u65f6\u63d0\u9ad8\u51c6\u786e\u6027\u3002 \u97f3\u9891\u5757\u548c\u6eda\u52a8\u7a97\u53e3 \u97f3\u9891\u5757\u5b9e\u65f6\u8f6c\u5f55\uff0c\u968f\u7740\u65b0\u5757\u7684\u5230\u6765\u548c\u66f4\u591a\u4e0a\u4e0b\u6587\u7684\u6dfb\u52a0\uff0c\u90e8\u5206\u7ed3\u679c\u5f97\u5230\u6539\u8fdb\u3002\u6682\u505c\u5c06\u7ed3\u679c\u6807\u8bb0\u4e3a\u6700\u7ec8\u7ed3\u679c\uff0c\u786e\u4fdd\u5feb\u901f\u51c6\u786e\u5730\u8f6c\u5f55\u52a8\u6001\u97f3\u9891\u6216\u89c6\u9891\u3002\u8981\u76f4\u89c2\u5730\u4e86\u89e3\u8fd9\u4e00\u70b9\uff0c\u8bf7\u53c2\u9605\u4e0b\u9762\u7684\u90e8\u5206\u7ed3\u679c\u8868\u3002 \u90e8\u5206\u7ed3\u679c\u548c\u6700\u7ec8\u7ed3\u679c 3\u3001\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u7cbe\u5ea6 \u8f6c\u5f55\u901f\u5ea6\u81f3\u5173\u91cd\u8981\uff0cWhisperFlow \u4ee5\u4ee4\u4eba\u5370\u8c61\u6df1\u523b\u7684\u5ef6\u8fdf\u8131\u9896\u800c\u51fa\u3002\u5728 Apple M1 \u82af\u7247\u4e0a\uff0cWhisperFlow &nbsp; \u7684\u5e73\u5747\u5ef6\u8fdf\u4e3a 275.22 \u6beb\u79d2\u2014\u2014\u5373\u4f7f\u5bf9\u4e8e\u5b9e\u65f6\u5e94\u7528\u7a0b\u5e8f\u6765\u8bf4\u4e5f\u975e\u5e38\u4f4e\u3002\u5728 GPU \u673a\u5668\u4e0a\uff0c\u6027\u80fd\u8fdb\u4e00\u6b65\u63d0\u9ad8\uff0c\u8d85\u8d8a\u4e86\u4ec5 CPU \u7684\u57fa\u51c6\uff0c\u4ece\u800c\u80fd\u591f\u66f4\u5feb\u5730\u5904\u7406\u5927\u578b\u4efb\u52a1\u3002WhisperFlow \u53ef\u786e\u4fdd\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u9ad8\u6548\u5feb\u901f\u5730\u8fd0\u884c\uff0c\u800c\u4e0d\u4f1a\u5f71\u54cd\u51c6\u786e\u6027\u3002 4\u3001\u8f7b\u677e\u4e0e Python \u548c FastAPI \u96c6\u6210 WhisperFlow \u4e0d\u4f1a\u4f7f\u5f00\u53d1\u4eba\u5458\u7684\u751f\u6d3b\u53d8\u5f97\u590d\u6742\u3002\u5b83\u7684\u6253\u5305\u65b9\u5f0f\u4f7f\u96c6\u6210\u5230\u73b0\u6709 Python [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-53745","post","type-post","status-publish","format-standard","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=53745"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53745\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}