]> njoseph.me Git - babashka-scripts.git/blobdiff - ebook-to-audio-book
ebook-to-audio-book: Get the correct default voice
[babashka-scripts.git] / ebook-to-audio-book
index ec12e96e479cbba58baaa0ccc00143224e93f095..ce2fe4bf571571a43fdf1a95a2e168192bd9e072 100755 (executable)
@@ -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