<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Voice on Love</title>
    <link>http://www.edu365.site:80/tags/voice/</link>
    <description>Recent content in Voice on Love</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <managingEditor>haoyuli@protonmail.com (haoyuli)</managingEditor>
    <webMaster>haoyuli@protonmail.com (haoyuli)</webMaster>
    <copyright>haoyuli</copyright>
    <lastBuildDate>Wed, 13 May 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="http://www.edu365.site:80/tags/voice/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>只需两行代码，实现语音转文字（转载）</title>
      <link>http://www.edu365.site:80/posts/blog/voice-text/</link>
      <pubDate>Wed, 13 May 2026 00:00:00 +0000</pubDate><author>haoyuli@protonmail.com (haoyuli)</author>
      <guid>http://www.edu365.site:80/posts/blog/voice-text/</guid>
      <description>&lt;p&gt;🚀 只需两行代码，实现语音转文字（Whisper-ctranslate2）&lt;/p&gt;&#xA;&lt;p&gt;这是目前我发现&lt;strong&gt;最快、最简单&lt;/strong&gt;的语音转文字方案之一。&lt;/p&gt;&#xA;&lt;p&gt;一个小时的音频文件，只需要几分钟就可以完成处理，非常适合做字幕、笔记整理、访谈转录等场景。&lt;/p&gt;&#xA;&lt;p&gt;它不仅支持多语言（英语 + 96种语言），还能在&lt;strong&gt;噪音环境&lt;/strong&gt;下保持不错的识别效果，即使口音较重也能处理。&lt;/p&gt;&#xA;&lt;p&gt;最重要的是：&lt;br&gt;&#xA;👉 &lt;strong&gt;完全免费 + 开源&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;我们使用的是 &lt;code&gt;whisper-ctranslate2&lt;/code&gt;，这是基于 OpenAI Whisper 的升级版本（OpenAI 也就是开发 ChatGPT 的公司）。&lt;/p&gt;&#xA;&lt;p&gt;相比原版 Whisper，它的特点是：&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;⚡ 速度更快&lt;/li&gt;&#xA;&lt;li&gt;🎯 精度更高&lt;/li&gt;&#xA;&lt;li&gt;🧠 使用更简单&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h1 id=&#34;-安装第一行代码&#34;&gt;🧩 安装（第一行代码）&lt;/h1&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pip install git+https://github.com/Softcatala/whisper-ctranslate2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;-语音转文字第二行代码&#34;&gt;🎧 语音转文字（第二行代码）&lt;/h1&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;whisper-ctranslate2 audio.mp3 --device cuda --model large-v3&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;-翻译成英文英文字幕&#34;&gt;🌍 翻译成英文（英文字幕）&lt;/h1&gt;&#xA;&lt;p&gt;如果你想直接把语音翻译成英文：&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;whisper-ctranslate2 audio.mp3 --device cuda --model large-v3 --task translate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;-中文识别优化简体--繁体&#34;&gt;🇨🇳 中文识别优化（简体 / 繁体）&lt;/h1&gt;&#xA;&lt;p&gt;简体中文优化：&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;whisper-ctranslate2 audio.mp3 --device cuda --model large-v3 --initial_prompt 这是一段中文普通话&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;📦 支持输出格式&lt;/p&gt;&#xA;&lt;p&gt;该工具可以输出多种格式，包括：&lt;/p&gt;&#xA;&lt;p&gt;TXT（纯文本）&#xA;SRT（字幕文件）&#xA;VTT（网页字幕）&#xA;JSON（结构化数据）&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
