CLI tool for macOS that transcribes speech from the microphone using Apple’s speech recognition API, SFSpeechRecognizer. (help.)

Overview

transcriber

CLI tool for macOS that uses SFSpeechRecognizer to transcribe speech from the microphone. The recognition result will be written to the standard output as JSON string.

Example screenshot

⚠️ 🚧 WARNING: 💩 code ahead 🚧 ⚠️

HELP WANTED

  • I am a Swift noob. I don’t know how to turn this code into binary... I click run on Xcode and it kinda works, but if I run the binary from the terminal, it crashes.
  • There is no error handling here, sometimes it doesn’t work. I don’t know why.

Some help would be appreciated.

How to use

Open the Xcode project and click Run. Make sure Dictation feature is enabled in your system preferences, easiest way to enable this is by enabling Siri.

Change the language

Add a locale to the source code like this and run:

-    private let speechRecognizer = SFSpeechRecognizer()
+    private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "th"))

Ideas

  • Add CLI argument to allow the user to specify the language. Maybe using ArgumentParser? Not sure.
  • Turn this into an HTTP speech recognition server that streams out server-sent events, so other apps can integrate with it, I guess?
You might also like...
Phiole - Allow to write or read from standards stream or files for script or CLI application

No longer maintained! Phiole - Φole Simple object to wrap three NSFileHandle: 'output', 'error' to write and 'input' to read There is of course a defa

Snpm - Snippet Manager CLI With Swift

Snippet Manager CLI Usage foo@bar:~$ snpm --help OVERVIEW: Utill for searching s

Swift-cli - Example of building command-line tools in Swift
Swift-cli - Example of building command-line tools in Swift

swift-cli Example of building command-line tools in Swift Step 1: Create CLI wit

A CLI to Alcatraz, the Xcode package manager.
A CLI to Alcatraz, the Xcode package manager.

Azkaban This project is deprecated in favor of Editor Extensions support in Xcode 8+. A CLI to Alcatraz, the Xcode package manager. Usage Install a pl

Tool for running macOS guest virtual machines in macOS 12 host or higher on M1 arm64 Macs

macosvm macosvm is a command line tool which allows creating and running of virtual machines on macOS 12 (Monterey) using the new Virtualization frame

Swiftline is a set of tools to help you create command line applications
Swiftline is a set of tools to help you create command line applications

Swiftline is a set of tools to help you create command line applications. Swiftline is inspired by highline Swiftline contains the following: Colorize

A command line application to create 3D models based on photogrametry using the macOS Monterey RealityCapture API.

PhotogrametryTool Generate 3D objects from images using RealityKit Object Capture. This project is a fork of the HelloPhotogrametry application by App

A nifty command-line tool to customize macOS icons

iconset A nifty command line tool to manage macOS icons iconset is a new command line tool for macOS that allows you to change icons for macOS apps (e

A Mac command-line tool that automatically downloads macOS Installers / Firmwares.
A Mac command-line tool that automatically downloads macOS Installers / Firmwares.

MIST - macOS Installer Super Tool A Mac command-line tool that automatically downloads macOS Installers / Firmwares: Features List all available macOS

Comments
  • Build CLI & allow change locale/language

    Build CLI & allow change locale/language

    instructions on how to compile/install instructions on how to change language at runtime a start to a GitHub action to release (it currently compiles - doesn't upload a release to GitHub)

    I'm also a swift noob - luck, google & copilot saved the day

    opened by anotherjesse 0
  • Simply run the program in a terminal window

    Simply run the program in a terminal window

    I have no problems running the compiled (with debug enabled) binary from the command line. OTOH, I see a bunch of errors when building and running it in XCode (but it works there, too).

    opened by chrillek 1
  • Create GitHub Action workflow to compile the project into a working binary.

    Create GitHub Action workflow to compile the project into a working binary.

    Right now the project can be run from Xcode, but I don't know how to turn this into an executable CLI that people can download and use. Since I am a noob at Swift, some help would be appreciated.

    image

    Expected

    • A GitHub Workflow action that generates a working binary file along with Info.plist.
    • When the binary is run, it should request Speech Recognition and Microphone usage. Whatever you say into the microphone should be printed on the console.
    opened by dtinth 0
Owner
Thai Pangsakulyanont
JavaScript musician????? CSS layout destroyer!!!!!
Thai Pangsakulyanont
An extremely simple CLI tool that was created to diagnose and further understand an issue in DriverKit causing kIOHIDOptionsTypeSeizeDevice to behave incorrectly when used in DriverKit system extensions.

IOKitHIDKeyboardTester This tool is NOT useful to, or intended for general users. IOKitHIDKeyboardTester is an extremely simple (one-file!) CLI tool t

Karen/あけみ 6 Jul 22, 2022
ConcurrentTest - Swift macOS CLI example on how to NOT do concurrent coding

Swift Concurrent Test Open the .xcodeproj file in Xcode, and try running it seve

Thisura Dodangoda 0 Jan 21, 2022
A CLI too powered by Swift to provision environments using an up.toml manifest file

tuist-up tuist up was originally a Tuist built-in command to provision environments by reading the requirements in a manifest file Setup.swift. Althou

Tuist 5 Mar 31, 2022
RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync

Hi there ?? RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync. It is rsync which executes the synchronize ta

Thomas Evensen 1.1k Dec 23, 2022
Guaka - Smart and beautiful POSIX compliant CLI framework for Swift.

Guaka - Smart and beautiful POSIX compliant CLI framework for Swift. It helps you create modern and familiar CLI apps in the vein of widely used proje

Omar Abdelhafith 1.1k Dec 24, 2022
A silly CLI for replacing macosx.internal SDK settings in .xcodeproj files with macosx

fix-macos-internal-sdk A silly CLI for replacing macosx.internal SDK settings in .xcodeproj files with macosx.

Keith Smiley 14 Dec 6, 2022
A starting point to create CLI utilities with swift

cli tuist template A starting point to create CLI utilities with swift Installation Just create a Tuist folder and a Templates folder inside it. Creat

humdrum 6 May 3, 2022
A Tuist Template to quickly create CLI apps in Swift

macOS CLI Template Motivation I'm writing more and more Swift CLI apps these days. And as I solve more problems with this litte tools, I find that I'm

Diego Freniche 21 Dec 28, 2022
A cli program written in swift (with async/await) that removes the unnecessary parts of xcframeworks.

xctrim A cli program written in swift (with async/await) that removes the unnecessary parts of xcframeworks. Usecase Say you downloaded firebase sdk a

Mustafa Yusuf 32 Jul 18, 2022
A library and CLI Utility to manage NVRAM Stuff, written in Swift.

NVRAMKit A Library and CLI Utility to manage NVRAM Stuff, written in Swift. Library Adding Library to Project Simply add this line to the dependencies

Serena 7 Sep 25, 2022