mirror of
https://github.com/DrewThomasson/ebook2audiobook.git
synced 2026-01-07 21:14:06 -05:00
Remove unnecessary files that were not supposed to be in PIPER TTS PR
Co-authored-by: DrewThomasson <126999465+DrewThomasson@users.noreply.github.com>
This commit is contained in:
@@ -1,104 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Demonstration script showing that piper-tts is properly integrated into ebook2audiobook.
|
||||
This script shows the configuration is working without requiring model downloads.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add the current directory to Python path for importing
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
|
||||
def demonstrate_piper_integration():
|
||||
"""Demonstrate that piper-tts is properly integrated"""
|
||||
print("🎯 Piper-TTS Integration Demonstration")
|
||||
print("=" * 50)
|
||||
|
||||
try:
|
||||
# Import and show TTS engines
|
||||
from lib.models import TTS_ENGINES, default_engine_settings, models
|
||||
print("📋 Available TTS Engines:")
|
||||
for name, engine_id in TTS_ENGINES.items():
|
||||
marker = "🆕" if name == "PIPER" else " "
|
||||
print(f" {marker} {name}: {engine_id}")
|
||||
|
||||
print(f"\n✅ PIPER engine successfully added to TTS_ENGINES")
|
||||
|
||||
# Show piper configuration
|
||||
piper_config = default_engine_settings[TTS_ENGINES['PIPER']]
|
||||
print(f"\n🔧 PIPER Configuration:")
|
||||
for key, value in piper_config.items():
|
||||
if key == 'voices':
|
||||
print(f" {key}: {len(value)} voices available")
|
||||
for voice_id, voice_name in list(value.items())[:3]:
|
||||
print(f" - {voice_id}: {voice_name}")
|
||||
if len(value) > 3:
|
||||
print(f" ... and {len(value) - 3} more")
|
||||
else:
|
||||
print(f" {key}: {value}")
|
||||
|
||||
# Show model configuration
|
||||
piper_models = models[TTS_ENGINES['PIPER']]
|
||||
print(f"\n📦 PIPER Model Configuration:")
|
||||
for model_name, model_config in piper_models.items():
|
||||
print(f" {model_name}:")
|
||||
for key, value in model_config.items():
|
||||
print(f" {key}: {value}")
|
||||
|
||||
print(f"\n🎉 Integration Test Results:")
|
||||
print(f" ✅ PIPER added to TTS_ENGINES dictionary")
|
||||
print(f" ✅ PIPER configuration added to default_engine_settings")
|
||||
print(f" ✅ PIPER models configuration added")
|
||||
print(f" ✅ lib.classes.tts_engines.coqui.py updated to handle PIPER")
|
||||
print(f" ✅ app.py updated with --voice_model argument")
|
||||
print(f" ✅ lib.functions.py updated to pass voice_model parameter")
|
||||
print(f" ✅ requirements.txt updated with piper-tts dependencies")
|
||||
|
||||
print(f"\n🚀 Ready to Use:")
|
||||
print(f" Users can now select 'PIPER' as their TTS engine")
|
||||
print(f" Available voices: {', '.join(list(piper_config['voices'].keys())[:3])}...")
|
||||
print(f" The system will automatically download models as needed")
|
||||
print(f" Integration follows the same pattern as existing engines")
|
||||
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Demonstration failed: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return False
|
||||
|
||||
def show_usage_example():
|
||||
"""Show how users would use the piper-tts integration"""
|
||||
print(f"\n📖 Usage Example:")
|
||||
print(f" When running ebook2audiobook with piper-tts:")
|
||||
print(f" ")
|
||||
print(f" # Command line usage:")
|
||||
print(f" ./ebook2audiobook.sh --headless --ebook mybook.epub \\")
|
||||
print(f" --tts_engine PIPER --voice_model en_US-lessac-medium")
|
||||
print(f" ")
|
||||
print(f" # Or via the web interface:")
|
||||
print(f" 1. Select 'PIPER' from TTS Engine dropdown")
|
||||
print(f" 2. Choose a voice from available piper voices")
|
||||
print(f" 3. Upload your ebook and start conversion")
|
||||
print(f" ")
|
||||
print(f" The system will:")
|
||||
print(f" - Automatically download the selected voice model")
|
||||
print(f" - Use piper-tts for fast, high-quality synthesis")
|
||||
print(f" - Create the audiobook with chapters and metadata")
|
||||
|
||||
def main():
|
||||
"""Run the demonstration"""
|
||||
success = demonstrate_piper_integration()
|
||||
|
||||
if success:
|
||||
show_usage_example()
|
||||
print(f"\n✨ Piper-TTS integration is complete and ready to use!")
|
||||
return 0
|
||||
else:
|
||||
print(f"\n❌ Integration demonstration failed.")
|
||||
return 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user