From c9e9b7c91e955349f4ec7a0d1e74435bc73ae8d6 Mon Sep 17 00:00:00 2001 From: Kingston-SCYD Date: Sat, 6 Jun 2026 19:45:12 -0500 Subject: [PATCH] morshu-server: add proper start script and systemd service --- ttstoy/morshu-server/morshu-server.service | 15 +++++++++++ ttstoy/morshu-server/start.sh | 31 +++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 ttstoy/morshu-server/morshu-server.service diff --git a/ttstoy/morshu-server/morshu-server.service b/ttstoy/morshu-server/morshu-server.service new file mode 100644 index 0000000..681c04b --- /dev/null +++ b/ttstoy/morshu-server/morshu-server.service @@ -0,0 +1,15 @@ +[Unit] +Description=Morshu TTS Server +After=network.target + +[Service] +Type=simple +User=owen +WorkingDirectory=/home/owen/Desktop/ttstoy/morshu-server +Environment=PORT=3002 +ExecStart=/usr/bin/python3 /home/owen/Desktop/ttstoy/morshu-server/server.py +Restart=always +RestartSec=3 + +[Install] +WantedBy=multi-user.target diff --git a/ttstoy/morshu-server/start.sh b/ttstoy/morshu-server/start.sh index a5cfbfc..a8981fe 100755 --- a/ttstoy/morshu-server/start.sh +++ b/ttstoy/morshu-server/start.sh @@ -1,4 +1,33 @@ #!/bin/bash -# Start Morshu TTS Server + +# Quick start script for Morshu TTS Server + +echo "🗣️ Starting Morshu TTS Server..." + cd "$(dirname "$0")" + +# Check if python3 is available +if ! command -v python3 &> /dev/null; then + echo "❌ Error: python3 is not installed" + exit 1 +fi + +# Check required Python packages +for pkg in pydub nltk g2p_en numpy; do + if ! python3 -c "import $pkg" 2>/dev/null; then + echo "❌ Error: Python package '$pkg' is not installed" + echo "Install it with: pip install $pkg" + exit 1 + fi +done + +# Check if the morshu wav file exists +if [ ! -f "../morshutalk_morshu.wav" ]; then + echo "❌ Error: morshutalk_morshu.wav not found in parent directory" + exit 1 +fi + +# Start the server +echo "✅ Starting server on port ${PORT:-3002}..." +echo "🗣️ Using MorshuTalk engine" exec python3 server.py