Skill: henrique-simoes/audio-ptbr-aprimorado (version 2.0.1)

--- name: audio-ptbr-autoreply version: 2.0.1 description: | Premium Portuguese-Brazilian voice interface with neural TTS and Claude AI integration. Features wav2vec2-large-xlsr-53-ptBR for excellent PT-BR understanding (slang, expressions, accents) + optional Claude API for intelligent responses. Multiple neural voices (3 masculine, 1 feminine). Silent audio-in/audio-out by default with one-command installation. category: voice tags: - voice - audio - speech-to-text - text-to-speech - portuguese - accessibility hooks: - event: "message.audio.receive" action: "bash process.sh \"{{MediaPath}}\" \"{{Target}}\" \"{{MessageID}}\"" triggers: - command: "/voz" description: "Configurar voz ou processar áudio manualmente" action: "bash process.sh \"{{args}}\"" config: tools: media: audio: scope: default: "allow" --- # Audio PT Auto-Reply v2.0.1 - Premium Voice Interface **Complete voice interface with superior Brazilian Portuguese understanding and automatic setup.** ## 🌟 Key Features ### Superior PT-BR Understanding - **Model:** wav2vec2-large-xlsr-53-portuguese (jonatasgrosman) - **Excellence in:** Brazilian Portuguese with slang, expressions, accents - **Also supports:** English (multilingual) - **Quality:** State-of-the-art for PT-BR ASR ### 🤖 Optional Claude Integration - **Intelligent responses** using Claude API - **Falls back** to OpenClaw agent automatically - **Optional:** No API key required, still works with OpenClaw agent - **Smart:** Better understanding of context and Portuguese nuances ### Neural Voice Options (Piper TTS) | Voice | Gender | Quality | Character | |-------|--------|---------|-----------| | **jeff** | Masculina | Medium | Clear, professional | | **cadu** | Masculina | Medium | Warm, natural | | **faber** | Masculina | Medium | Balanced | | **miro** | Feminina | High | Community voice | ### Voice Commands Change voice anytime with: - `/voz jeff` - Voice: Jeff - `/voz cadu` - Voice: Cadu - `/voz faber` - Voice: Faber - `/voz miro` - Voice: Miro (feminina) - `/voz feminina` - Automatic: miro - `/voz masculina` - Automatic: jeff - `/voz listar` - Show all voices ## ⚡ Installation (NEW!) ### One-Command Installation ```bash bash install.sh ``` The installer automatically: - ✅ Detects your system architecture (ARM64, x86_64) - ✅ Downloads Piper TTS - ✅ Downloads 4 Brazilian Portuguese voice models (~240MB) - ✅ Installs Python dependencies - ✅ Validates everything works **No manual downloads. No configuration. Just one command!** ## 🔄 Critical Rules **DEFAULT: AUDIO ONLY - NO TEXT** When user sends audio: - ❌ NO transcription shown - ❌ NO "Pesquisando...", "Gerando..." - ❌ NO confirmations or explanations - ✅ ONLY audio reply **TEXT MODE:** Say "texto" or "responda em texto" explicitly ## 📊 Workflow ``` 🎤 Audio Received (PT-BR/EN) ↓ 🔤 Transcribe (wav2vec2 PT-BR - silent) ↓ 🤖 AI Response (Claude API or OpenClaw Agent - silent) ↓ 🗣️ Synthesize (Piper neural - silent) ↓ 📤 Send Audio Reply (silent) ``` ## 📁 Scripts ### Installation & Setup - `install.sh` - Automatic installation (run once!) - `health_check.py` - Validate the installation ### Core Processing - `transcribe.py` - wav2vec2 PT-BR speech recognition - `synthesize.py` - Piper TTS with voice selection - `voice_config.py` - Voice preference management - `process.sh` - Full workflow orchestration ### AI Integration - `claude_adapter.py` - Claude API bridge (intelligent responses) ## 🔧 Configuration ### Optional: Enable Claude Integration For intelligent AI responses, set your API key: ```bash export ANTHROPIC_API_KEY="sk-your-api-key" ``` Without this, the skill uses OpenClaw's agent (still great responses!). ### Voice Configuration Current voice is saved automatically in: ``` ~/.openclaw/workspace/.audio_pt_voice_config ``` ## 📊 Technical Details ### ASR Model - **Name:** jonatasgrosman/wav2vec2-large-xlsr-53-portuguese - **Training:** Fine-tuned on PT-BR Common Voice + other datasets - **Strengths:** Brazilian slang, regional expressions, informal speech - **License:** Apache 2.0 ### TTS Engine - **Engine:** Piper (fast, local neural TTS) - **Voices:** 4 PT-BR options - **Speed:** Real-time on ARM64/x64 - **Format:** Opus OGG (Telegram optimized) - **License:** MIT ### AI Response (Optional) - **Primary:** Claude API (when API key provided) - **Fallback:** OpenClaw Agent (always available) - **License:** Claude API is proprietary; OpenClaw Agent is included ## 🚀 Getting Started 1. **Install skill** from ClaWHub 2. **Run:** `bash install.sh` 3. **Restart:** `openclaw gateway restart` 4. **Use:** Send audio messages, use `/voz` commands ## 📋 Requirements - OpenClaw 2026.4.10+ - Python 3.8+ - 300MB free disk space (for voice models) - Internet connection (for initial downloads) - Optional: ANTHROPIC_API_KEY for Claude integration ## 🔒 Privacy & Security - ✅ Audio transcription happens locally (wav2vec2 runs on your machine) - ✅ Voice synthesis happens locally (Piper runs on your machine) - ⚠️ AI responses: - Without API key: Processed by OpenClaw Agent (check OpenClaw privacy) - With API key: Sent to Anthropic (Claude respects prompt privacy per TOS) ## 📜 License MIT - Free to use, modify, and redistribute ## 🙏 Credits - ASR: [jonatasgrosman/wav2vec2-large-xlsr-53-portuguese](https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-portuguese) - TTS: [Piper](https://github.com/rhasspy/piper) by Rhasspy - AI: [Claude API](https://www.anthropic.com) by Anthropic (optional) - Voices: Piper Voices repository + TarcisoAmorim community contribution

path: _meta.json
content: ownerId: kn7d13re5xd7rac3vrjg74bgk584mgyg
slug: audio-ptbr-aprimorado
version: 2.0.1
publishedAt: 1775907379922

path: requirements.txt
content: # Audio PT Auto-Reply - Python Dependencies
# PINNED versions for reproducibility

# Core ML & Audio (heavy dependencies - make optional)
torch==2.1.2
torchaudio==2.1.2
transformers==4.36.2

# Optional: Claude API for intelligent responses
anthropic>=0.19.0

# Utilities
numpy==1.24.3

# Performance & Monitoring
tqdm==4.66.1          # Progress bars for model loading

# Development/Testing (optional, not in prod install)
# pytest==7.4.3
# black==23.12.0

# Installation groups:
# 
# Production (minimal):
#   pip install -e ".[core]"
#
# Full (with Claude):
#   pip install -e ".[full]"
#
# Development:
#   pip install -e ".[dev]"


path: install.sh
content: #!/bin/bash
# Audio PT Auto-Reply - Automatic Installation Script
# Detects architecture, downloads Piper, voice models, and dependencies

set -e

echo "🎙️  Audio PT Auto-Reply - Smart Installation"
echo "=============================================="
echo ""

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

# Detect architecture
ARCH=$(uname -m)
OS=$(uname -s)

echo -e "${BLUE}[1/6] Detecting system...${NC}"
echo "  Architecture: $ARCH"
echo "  OS: $OS"
echo ""

# Set Piper download URL based on architecture
case $ARCH in
  arm64|aarch64)
    PIPER_URL="https://github.com/rhasspy/piper/releases/download/v1.2.0/piper_arm64.tar.gz"
    PIPER_FILE="piper_arm64.tar.gz"
    echo -e "${GREEN}✓ ARM64 detected (Raspberry Pi, Apple Silicon)${NC}"
    ;;
  x86_64|amd64)
    PIPER_URL="https://github.com/rhasspy/piper/releases/download/v1.2.0/piper_x86_64.tar.gz"
    PIPER_FILE="piper_x86_64.tar.gz"
    echo -e "${GREEN}✓ x86_64 detected (Intel/AMD)${NC}"
    ;;
  *)
    echo -e "${RED}✗ Unsupported architecture: $ARCH${NC}"
    exit 1
    ;;
esac

# Setup paths
WORKSPACE="${HOME}/.openclaw/workspace"
PIPER_DIR="${WORKSPACE}/piper"
VOICES_DIR="${PIPER_DIR}"
SKILL_DIR="${WORKSPACE}/skills/audio-ptbr-autoreply"
VENV="${WORKSPACE}/venv"

echo ""
echo -e "${BLUE}[2/6] Creating directories...${NC}"
mkdir -p "$PIPER_DIR"
mkdir -p "$VOICES_DIR"
mkdir -p "$(dirname $SKILL_DIR)"
echo -e "${GREEN}✓ Directories created${NC}"

echo ""
echo -e "${BLUE}[3/6] Installing Python dependencies...${NC}"

# Check for required system tools
for cmd in python3 pip ffmpeg; do
  if ! command -v $cmd &> /dev/null; then
    echo -e "${YELLOW}⚠ $cmd not found. Installing...${NC}"
    if [[ "$OS" == "Linux" ]]; then
      sudo apt-get update && sudo apt-get install -y $cmd
    elif [[ "$OS" == "Darwin" ]]; then
      brew install $cmd
    fi
  fi
done

# Install Python dependencies
python3 -m pip install --upgrade pip setuptools wheel > /dev/null 2>&1
python3 -m pip install -q transformers torch torchaudio anthropic

if [ -d "$VENV" ]; then
  source "$VENV/bin/activate"
  python -m pip install -q transformers torch torchaudio anthropic
  deactivate
fi

echo -e "${GREEN}✓ Python dependencies installed${NC}"

echo ""
echo -e "${BLUE}[4/6] Downloading Piper TTS...${NC}"

if [ -f "$PIPER_DIR/piper/piper" ]; then
  echo -e "${GREEN}✓ Piper already installed${NC}"
else
  echo "  Downloading from: $PIPER_URL"
  cd "$PIPER_DIR"
  wget -q "$PIPER_URL" -O "$PIPER_FILE"
  tar xzf "$PIPER_FILE"
  rm "$PIPER_FILE"
  chmod +x "$PIPER_DIR/piper/piper"
  echo -e "${GREEN}✓ Piper installed successfully${NC}"
fi

echo ""
echo -e "${BLUE}[5/6] Downloading voice models (this may take a while)...${NC}"

# Voice models with their URLs
declare -A VOICES=(
  ["pt_BR-jeff-medium.onnx"]="https://huggingface.co/rhasspy/piper-voices/resolve/main/pt/pt_BR/jeff/medium/pt_BR-jeff-medium.onnx"
  ["pt_BR-jeff-medium.onnx.json"]="https://huggingface.co/rhasspy/piper-voices/resolve/main/pt/pt_BR/jeff/medium/pt_BR-jeff-medium.onnx.json"
  ["pt_BR-cadu-medium.onnx"]="https://huggingface.co/rhasspy/piper-voices/resolve/main/pt/pt_BR/cadu/medium/pt_BR-cadu-medium.onnx"
  ["pt_BR-cadu-medium.onnx.json"]="https://huggingface.co/rhasspy/piper-voices/resolve/main/pt/pt_BR/cadu/medium/pt_BR-cadu-medium.onnx.json"
  ["pt_BR-faber-medium.onnx"]="https://huggingface.co/rhasspy/piper-voices/resolve/main/pt/pt_BR/faber/medium/pt_BR-faber-medium.onnx"
  ["pt_BR-faber-medium.onnx.json"]="https://huggingface.co/rhasspy/piper-voices/resolve/main/pt/pt_BR/faber/medium/pt_BR-faber-medium.onnx.json"
  ["pt_BR-miro-high.onnx"]="https://huggingface.co/TarcisoAmorim/piper-pt_BR-miro-high/resolve/main/model.onnx"
  ["pt_BR-miro-high.onnx.json"]="https://huggingface.co/TarcisoAmorim/piper-pt_BR-miro-high/resolve/main/config.json"
)

cd "$VOICES_DIR"
for voice_file in "${!VOICES[@]}"; do
  if [ ! -f "$voice_file" ]; then
    echo "  Downloading $voice_file..."
    wget -q "${VOICES[$voice_file]}" -O "$voice_file" || echo -e "${YELLOW}⚠ Failed to download $voice_file${NC}"
  fi
done

echo -e "${GREEN}✓ Voice models ready${NC}"

echo ""
echo -e "${BLUE}[6/6] Finalizing setup...${NC}"

# Make scripts executable
chmod +x "$SKILL_DIR/scripts/"*.py 2>/dev/null || true
chmod +x "$SKILL_DIR/scripts/"*.sh 2>/dev/null || true

# Create config directory if needed
mkdir -p "$(dirname $WORKSPACE/.audio_pt_voice_config)"

echo -e "${GREEN}✓ Setup complete!${NC}"

echo ""
echo "=============================================="
echo -e "${GREEN}✅ Installation successful!${NC}"
echo "=============================================="
echo ""
echo "📝 Next steps:"
echo "  1. Restart OpenClaw: openclaw gateway restart"
echo "  2. Try voice commands:"
echo "     /voz list        - Show available voices"
echo "     /voz jeff        - Use Jeff voice"
echo "     /voz miro        - Use Miro (feminine)"
echo ""
echo "💡 Tips:"
echo "  • Send audio message → Receive voice reply"
echo "  • Say 'texto' for text mode"
echo "  • Use /voz command to change voices"
echo ""
echo "📊 Installation Summary:"
echo "  Piper: $PIPER_DIR"
echo "  Voices: $VOICES_DIR"
echo "  Config: $WORKSPACE/.audio_pt_voice_config"
echo ""


Security scan verdicts — ClawScan: suspicious | static analysis: suspicious | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)