From: Joseph Nuthalapati Date: Wed, 5 Jan 2022 13:22:39 +0000 (+0530) Subject: ebook-to-audio-book: Get the correct default voice X-Git-Url: https://njoseph.me/gitweb/babashka-scripts.git/commitdiff_plain/746d64040956017457d38f0bf59649e96d0ab449?hp=269ff235d32dde012c671f258fcbdeba6504144f ebook-to-audio-book: Get the correct default voice --- diff --git a/ebook-to-audio-book b/ebook-to-audio-book index ec12e96..ce2fe4b 100755 --- a/ebook-to-audio-book +++ b/ebook-to-audio-book @@ -2,15 +2,18 @@ ; -*- mode: clojure -*- ; A utility to listen to your ebooks using TTS programs +; +; This utility only works on macOS for now. (require '[clojure.java.io :as io] '[clojure.string :refer [split]] '[lib :refer [run-cmd extract-file-from-zip unixify]]) ;; TODO Check if all required utilities are installed - ;; TODO Allow voice selection -(println "Selected voice is Samantha") + +(let [default-voice (run-cmd ["defaults" "read" "com.apple.speech.voice.prefs" "SelectedVoiceName"])] + (println (str "Will read using the default voice " default-voice))) ;; TODO Use festival-tts or say depending on OS