45 lines
1.7 KiB
Bash
Executable File
45 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright 2026 Umbra Tools (umbratools.com)
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Package the voice reference wavs + cached ICL voice prompts (.pt) so they can
|
|
# be copied to the target TTS server machine (GPU). The remote ChapterBuilder /
|
|
# server uses these to generate every utterance with each speaker's identical
|
|
# voice identity.
|
|
#
|
|
# Usage (run ON THIS Mac):
|
|
# ./sync_voice_data.sh [target_host:dir]
|
|
# - with no args: writes a tarball ./voice_data.tar.gz you can scp manually
|
|
# - with a scp-style target (user@host:/path): copies it there and extracts
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
PROJ="$(cd "$SCRIPT_DIR" && pwd)"
|
|
UMBRA_DATA="${UMBRA_DATA_DIR:-/Volumes/1TB_APL_Storage/UmbraAudio}"
|
|
PROJECT_SLUG="${PROJECT_SLUG:-DealHunterShip_4.0e_whole-to-audio}"
|
|
PROJ="$UMBRA_DATA/$PROJECT_SLUG/.umbra"
|
|
TARBALL="$SCRIPT_DIR/voice_data.tar.gz"
|
|
|
|
TMP="$(mktemp -d)"
|
|
mkdir -p "$TMP/voices" "$TMP/voice_prompts"
|
|
|
|
echo ">> Bundling voice references + cached prompts"
|
|
cp "$PROJ"/voices/*_ref.wav "$TMP/voices/" 2>/dev/null || echo " no ref wavs"
|
|
cp "$PROJ"/voice_prompts/*.pt "$TMP/voice_prompts/" 2>/dev/null || echo " no cached prompts"
|
|
|
|
echo " voices: $(ls "$TMP/voices" | wc -l | tr -d ' ') files"
|
|
echo " prompts: $(ls "$TMP/voice_prompts" | wc -l | tr -d ' ') files"
|
|
|
|
tar -czf "$TARBALL" -C "$TMP" voices voice_prompts
|
|
rm -rf "$TMP"
|
|
ls -lh "$TARBALL" | awk '{print ">> Wrote", $9, "("$5")"}'
|
|
|
|
if [ $# -ge 1 ]; then
|
|
target="$1"
|
|
echo ">> Copying + extracting to $target"
|
|
scp "$TARBALL" "$target:"
|
|
ssh "${target%:*}" "mkdir -p voice_prompts && tar -xzf voice_data.tar.gz && mv voices/* voice_prompts/ 2>/dev/null; echo done"
|
|
fi
|