Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voice to Text Transcription

This repository contains two scripts for voice transcription:

  1. voicetotext: A simple script to record audio and save the transcription to a file.
  2. live_dictation: A script for live dictation that types as you speak.

Installation

To make these scripts runnable from anywhere, symbolic links have been created in /usr/local/bin. You can now run them by name from any terminal.

Dependencies:

  • ffmpeg: You'll need ffmpeg installed for audio recording. You can install it with Homebrew: brew install ffmpeg
  • whisper.cpp: This project uses whisper.cpp for transcription. You can install it with Homebrew: brew install whisper-cpp

How to Use

voicetotext (Save to File)

  1. Open a terminal window.
  2. Run the script:
    voicetotext
  3. Start speaking. The script will record your voice.
  4. Press Ctrl+C to stop recording.
  5. The transcribed text will be saved to /Users/tjm/Desktop/shorttermprojects/output.txt.

live_dictation (Live Typing)

  1. Open a terminal window.
  2. Run the script:
    live_dictation
  3. Switch to the application where you want to type.
  4. Start speaking. The script will transcribe your voice in 5-second intervals and type the text into the active window.
  5. Press Ctrl+C in the terminal window to stop the script.

How it Works

The live_dictation script works in a continuous loop:

  1. Records Audio: It uses ffmpeg to record 5-second chunks of audio from your default microphone.
  2. Transcribes Audio: The recorded audio is then passed to whisper-cpp for transcription.
  3. Simulates Keystrokes: The transcribed text is then typed out in the currently active window using AppleScript.

Troubleshooting

  • whisper-cpp: command not found: If you see this error, it means that whisper-cpp is not installed or not in your system's PATH. Make sure you have installed it via Homebrew (brew install whisper-cpp).
  • No text is being typed: Make sure you have given your terminal application the necessary accessibility permissions to control your computer. You can do this in System Settings > Privacy & Security > Accessibility.

Development

For a humorous look at the development of this script, please see the making_of.md file.

About

Voice to Text Transcription but weird

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages