[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/greader b417250e0d 02/17: First draft of the script tha
From: |
ELPA Syncer |
Subject: |
[elpa] externals/greader b417250e0d 02/17: First draft of the script that controls piper and aplay. |
Date: |
Wed, 18 Dec 2024 18:59:09 -0500 (EST) |
branch: externals/greader
commit b417250e0d3bcbac089afc2b3a8ed69870eebb09
Author: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
Commit: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
First draft of the script that controls piper and aplay.
---
greader-piper.el | 14 +++++++++++++-
piper.sh | 29 +++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/greader-piper.el b/greader-piper.el
index 4bc2279c86..4c436a61b1 100644
--- a/greader-piper.el
+++ b/greader-piper.el
@@ -15,4 +15,16 @@
;; along with this program. If not, see
;; <http://www.gnu.org/licenses/>.
-;;; commentary
+;;; commentary:
+;; This is the back-end for the piper synthesizer.
+;; It uses a shell script to call piper.
+
+;;; code:
+(defgroup greader-piper
+ nil
+ "piper back-end."
+ :group 'greader)
+
+(defcustom greader-piper-binary-path ""
+ "Path of the piper binary."
+ :type 'string)
diff --git a/piper.sh b/piper.sh
new file mode 100644
index 0000000000..bfa013edf5
--- /dev/null
+++ b/piper.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Piper parameters configuration
+MODEL="en_US-lessac-medium.onnx" # Text-to-speech model
+OUTPUT_FORMAT="raw" # Output format (e.g. raw, wav)
+SAMPLE_RATE=22050 # Sampling rate
+AUDIO_FORMAT="S16_LE" # Audio format for aplay
+
+# User input control
+if [ -z "$1" ]; then
+ echo "Usage: $0 \"Text to synthesize\""
+ exit 1
+fi
+
+TEXT="$1"
+
+# Check existence of model and Piper
+if [ ! -f "./piper" ]; then
+ echo "Error: The Piper executable file is not present in the current
directory."
+ exit 2
+fi
+
+if [ ! -f "$MODEL" ]; then
+ echo "Error: Model $MODEL is not present in the current directory."
+ exit 3
+fi
+
+# Text-to-speech flow
+echo "$TEXT" | ./piper --model "$MODEL" --output-$OUTPUT_FORMAT | aplay -r
"$SAMPLE_RATE" -f "$AUDIO_FORMAT" -t "$OUTPUT_FORMAT" -
- [elpa] externals/greader updated (91bbed50dd -> a24a0a5efe), ELPA Syncer, 2024/12/18
- [elpa] externals/greader 345f3f527b 06/17: Function `greader-read-asynchronous' fixed to work even on scripts., ELPA Syncer, 2024/12/18
- [elpa] externals/greader b417250e0d 02/17: First draft of the script that controls piper and aplay.,
ELPA Syncer <=
- [elpa] externals/greader b3233f4483 12/17: More fixes 4., ELPA Syncer, 2024/12/18
- [elpa] externals/greader 0f0362c507 08/17: Variable `greader-piper-script-path' fixed., ELPA Syncer, 2024/12/18
- [elpa] externals/greader e0abb03f47 04/17: Merge branch 'master' into 2-support-for-the-piper-synthesizer, ELPA Syncer, 2024/12/18
- [elpa] externals/greader 230b753158 05/17: ; ; greader-build-args function fixed, now should work even if the back-end does'nt provide features., ELPA Syncer, 2024/12/18
- [elpa] externals/greader f77876a34c 09/17: More fixes., ELPA Syncer, 2024/12/18
- [elpa] externals/greader f3cb6848e6 10/17: More fixes 2., ELPA Syncer, 2024/12/18
- [elpa] externals/greader 3090adb51b 03/17: First draft of `greader-piper' back-end., ELPA Syncer, 2024/12/18
- [elpa] externals/greader c654d388ca 11/17: More fixes 3., ELPA Syncer, 2024/12/18
- [elpa] externals/greader 3379adb8b8 16/17: Warnings pacified., ELPA Syncer, 2024/12/18
- [elpa] externals/greader 4de4d2d403 14/17: Document better `greader-backends' variable., ELPA Syncer, 2024/12/18