transcribe

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Transcribe

转录

Speech-to-text using Groq Whisper API.
使用Groq Whisper API实现语音转文字。

Setup

配置

The script needs
GROQ_API_KEY
environment variable. Check if already set:
bash
echo $GROQ_API_KEY
If not set, guide the user through setup:
  1. Ask if they have a Groq API key
  2. If not, have them sign up at https://console.groq.com/ and create an API key
  3. Have them add to their shell profile (~/.zshrc or ~/.bashrc):
    bash
    export GROQ_API_KEY="<their-api-key>"
  4. Then run
    source ~/.zshrc
    (or restart terminal)
脚本需要设置
GROQ_API_KEY
环境变量。检查是否已设置:
bash
echo $GROQ_API_KEY
如果未设置,引导用户完成配置:
  1. 询问用户是否拥有Groq API密钥
  2. 如果没有,让他们在https://console.groq.com/注册并创建API密钥
  3. 让他们将以下内容添加到shell配置文件(/.zshrc或/.bashrc)中:
    bash
    export GROQ_API_KEY="<their-api-key>"
  4. 然后运行
    source ~/.zshrc
    (或重启终端)

Usage

使用方法

bash
{baseDir}/transcribe.sh <audio-file>
bash
{baseDir}/transcribe.sh <音频文件>

Supported Formats

支持的格式

  • m4a, mp3, wav, ogg, flac, webm
  • Max file size: 25MB
  • m4a、mp3、wav、ogg、flac、webm
  • 最大文件大小:25MB

Output

输出

Returns plain text transcription with punctuation and proper capitalization to stdout.
将带有标点和正确大小写的纯文字转录结果输出到标准输出。