文章简介

当AI能实时听懂并翻译你的语音,世界会变成什么样?我们通过开源技术栈(STT+DeepSeek)实现了20秒语音8秒完成的实时翻译,成本低至7天旅行仅需3-6元。本文从技术选型、性能优化到应用场景全面解析,所有代码已在GitHub开源。无论你是开发者还是AI爱好者,欢迎一起探讨如何让技术更好地服务生活。


为什么让AI“听懂人话”如此重要?

就像去游乐园需要一张通票,我们希望用户与AI交流时也能“畅行无阻”——说话即所得
在上一篇文章中,我们论证了语音输入的经济性(成本降低80%)和实用性(响应速度提升3倍)。今天,我们带着实际成果来了:

嵌入式视频

Show Me the Code:技术实现与性能突破

数据说话,日志在文章末尾

  • 测试语音:20秒日常对话
  • STT耗时:12秒(开源组件,flet_sherpa_onnx)
  • API调用响应:8秒
  • 成本测算:基于DeepSeek API,假设一天听/写10w字,DeepSeek 3¥/百万Token的场景,一趟国庆长假7天旅游,大概翻译的成本在3~6¥左右。基本可以满足出行需求了。7天旅行翻译约3-6元。
  • 当然如果您是在国内开店的,外国人144小时免签来您这里消费。就像在店里有个随时待命的导购,不同的是——这位导购懂100多种语言,且随叫随到,不请假,没有三倍工资,没有社保

开源共建:邀请你一起让AI更懂人类

我们深知技术没有终点,我们诚邀

  1. 开发者直接使用代码(https://github.com/SamYuan1990/i18n-agent-action )
  2. 技术爱好者参与测试(https://www.bilibili.com/video/BV1SSxTzpEvU/)
  3. 任何建议或合作需求(欢迎私信交流)

就像组装乐高,每一块新代码都可能让这个项目变得更完整。我们相信开源的力量,更相信与你同行能让技术走得更远。

写在最后:技术乐观主义者的宣言

AI不是冷冰冰的代码,而是连接世界的桥梁。
当有人说“苹果只要12秒”时,我们选择用开源和迭代证明:技术民主化的意义在于让每个人都能享受科技进步的红利。

GitHub:https://github.com/SamYuan1990/i18n-agent-action
测试视频:https://www.bilibili.com/video/BV1SSxTzpEvU/

日志:

2025-10-05 14:03:46,804 - root - INFO - =================
2025-10-05 14:04:31,607 - root - INFO - 看看我们来一段这个也是结我这个AZN它进到了DipSync官方使用机成里然后最近做了这个音文字的支持那我们来看看这个音文字的效果怎么样就是这20秒左右的音版

2025-10-05 14:04:31,687 - root - INFO - =================

2025-10-05 14:04:31,688 - root - INFO - Error loading span data: 'Span' object has no attribute 'parent'

2025-10-05 14:04:31,689 - root - INFO - start translate URL or text

2025-10-05 14:04:31,689 - root - INFO - 看看我们来一段这个也是结我这个AZN它进到了DipSync官方使用机成里然后最近做了这个音文字的支持那我们来看看这个音文字的效果怎么样就是这20秒左右的音版

2025-10-05 14:04:31,689 - root - INFO - Processing chunk 1/1 of 看看我们来一段这个也是结我这个AZN它进到了DipSync官方使用机成里然后最近做了这个音文字的支持那我们来看看这个音文字的效果怎么样就是这20秒左右的音版

2025-10-05 14:04:31,756 - root - INFO - Checking cache for Messages: [{'role': 'system', 'content': 'You are a professional translator and a versatile expert with knowledge spanning various specialized fields, capable of handling technical, professional, and general content.\nCore Responsibilities:\nAccurately preserve the original meaning, context, and nuance during translation\nMaintain specialized terminology, proper nouns, command syntax, and special content fragments unchanged\nEnsure explanations and descriptions align with target language conventions while retaining accuracy\nHandle diverse content types, including but not limited to technical documentation, professional reports, academic materials, and general texts\nTranslation Methodology:\nAnalyze the source text to identify specialized terms, special formatting, and structural elements\nResearch appropriate expressions for proper nouns and terminology in the target language when necessary, and list all retained items in the result\nTranslate explanatory text while ensuring professional accuracy\nMaintain terminology consistency\nFully preserve all terminology and related content\nAdapt culturally specific examples as needed to facilitate target audience understanding\nQuality Assurance Steps:\nDo not add any extra explanations or markings\nDo not include any document chunking information (e.g., "This is Part X")\nStrictly preserve the original formatting and structure\nEnsure all specialized terms are accurately translated or retained in their original form\nVerify that code syntax, commands, and technical examples remain functional\nCheck that formatting and document structure are consistent\nConfirm that the translation maintains the same level of professional detail and accuracy as the original\nRetain all identified proper nouns\nProvide brief explanations in parentheses for ambiguous specialized terms or proper nouns (reference may be made to user-provided reserved words)\n '}, {'role': 'user', 'content': '\n Please help translate the following content into en, reserved word: in English.\n This is part 1 of 1 of the document.\n\n Example json output format:\n {\n "content": "translated text here...",\n "metadata": {"chunk": 1, "total": 1},\n "proper_nouns": "proper nouns 0, "proper nouns 1..."\n }\n\n Content to translate:\n 看看我们来一段这个也是结我这个AZN它进到了DipSync官方使用机成里然后最近做了这个音文字的支持那我们来看看这个音文字的效果怎么样就是这20秒左右的音版\n '}]

2025-10-05 14:04:31,756 - root - INFO - Request to LLM - Messages: [{'role': 'system', 'content': 'You are a professional translator and a versatile expert with knowledge spanning various specialized fields, capable of handling technical, professional, and general content.\nCore Responsibilities:\nAccurately preserve the original meaning, context, and nuance during translation\nMaintain specialized terminology, proper nouns, command syntax, and special content fragments unchanged\nEnsure explanations and descriptions align with target language conventions while retaining accuracy\nHandle diverse content types, including but not limited to technical documentation, professional reports, academic materials, and general texts\nTranslation Methodology:\nAnalyze the source text to identify specialized terms, special formatting, and structural elements\nResearch appropriate expressions for proper nouns and terminology in the target language when necessary, and list all retained items in the result\nTranslate explanatory text while ensuring professional accuracy\nMaintain terminology consistency\nFully preserve all terminology and related content\nAdapt culturally specific examples as needed to facilitate target audience understanding\nQuality Assurance Steps:\nDo not add any extra explanations or markings\nDo not include any document chunking information (e.g., "This is Part X")\nStrictly preserve the original formatting and structure\nEnsure all specialized terms are accurately translated or retained in their original form\nVerify that code syntax, commands, and technical examples remain functional\nCheck that formatting and document structure are consistent\nConfirm that the translation maintains the same level of professional detail and accuracy as the original\nRetain all identified proper nouns\nProvide brief explanations in parentheses for ambiguous specialized terms or proper nouns (reference may be made to user-provided reserved words)\n '}, {'role': 'user', 'content': '\n Please help translate the following content into en, reserved word: in English.\n This is part 1 of 1 of the document.\n\n Example json output format:\n {\n "content": "translated text here...",\n "metadata": {"chunk": 1, "total": 1},\n "proper_nouns": "proper nouns 0, "proper nouns 1..."\n }\n\n Content to translate:\n 看看我们来一段这个也是结我这个AZN它进到了DipSync官方使用机成里然后最近做了这个音文字的支持那我们来看看这个音文字的效果怎么样就是这20秒左右的音版\n '}]

2025-10-05 14:04:34,395 - httpx - INFO - HTTP Request: POST https://api.deepseek.com/chat/completions "HTTP/1.1 200 OK"

2025-10-05 14:04:39,787 - root - INFO - AZN, DipSync

2025-10-05 14:04:39,788 - root - INFO - Let's take a look at this segment, which is also related to my AZN. It has entered the DipSync official usage machine, and recently added support for phonetic text. Now, let's see how effective this phonetic text is, which is about this 20-second audio version.
Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐