Spaces:
Runtime error
Runtime error
initial commit
Browse files- .env +4 -0
- .gitignore +12 -0
- README.md +3 -13
- config/__pycache__/appconfig.cpython-312.pyc +0 -0
- config/appconfig.py +59 -0
- config/config.log +535 -0
- logs/voice_translator.log +28 -0
- requirements.txt +6 -0
- src/__pycache__/appconfig.cpython-312.pyc +0 -0
- src/find_voice.py +48 -0
- src/voice_translator.py +224 -0
- src/voice_translator_copy.py +332 -0
.env
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ASSEMBLYAI_API_KEY=b4e61344c7c540ee97dd845369269f7a
|
| 2 |
+
ELEVENLABS_API_KEY=sk_8fb81c166bbe842fc1ccc0dee07b0640aee23d64714e0186
|
| 3 |
+
# VOICE_ID=astCYLFsAfVQdrdLTbS5
|
| 4 |
+
VOICE_ID=X8p6aGE1votZZk0BMvbQ
|
.gitignore
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.mp3
|
| 2 |
+
.mp4
|
| 3 |
+
/__pycache__
|
| 4 |
+
./config/__pycache__
|
| 5 |
+
./src/__pycache__
|
| 6 |
+
.DS_Store
|
| 7 |
+
/flags
|
| 8 |
+
.env
|
| 9 |
+
.log
|
| 10 |
+
./logs/voice_translator.log
|
| 11 |
+
./config/config.log
|
| 12 |
+
.video
|
README.md
CHANGED
|
@@ -1,13 +1,3 @@
|
|
| 1 |
-
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
colorFrom: red
|
| 5 |
-
colorTo: yellow
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 5.9.1
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
short_description: Transform your voice into multiple languages instantly
|
| 11 |
-
---
|
| 12 |
-
|
| 13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
+
# 🌍 AI-Powered Multilingual Voice Translator
|
| 2 |
+
## Transform your voice into multiple languages instantly
|
| 3 |
+
### Record your message in English, and receive translations in multiple languages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config/__pycache__/appconfig.cpython-312.pyc
ADDED
|
Binary file (2.57 kB). View file
|
|
|
config/appconfig.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
from dotenv import load_dotenv
|
| 4 |
+
import logging
|
| 5 |
+
import sys
|
| 6 |
+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
| 7 |
+
|
| 8 |
+
# Configure logging
|
| 9 |
+
logging.basicConfig(
|
| 10 |
+
level=logging.INFO,
|
| 11 |
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
| 12 |
+
handlers=[
|
| 13 |
+
logging.FileHandler(r'config\config.log'),
|
| 14 |
+
logging.StreamHandler()
|
| 15 |
+
]
|
| 16 |
+
)
|
| 17 |
+
logger = logging.getLogger(__name__)
|
| 18 |
+
|
| 19 |
+
# Load environment variables from .env file in the root directory
|
| 20 |
+
env_path = Path(__file__).parent.parent / '.env'
|
| 21 |
+
if not env_path.exists():
|
| 22 |
+
logger.error(f"Environment file not found at {env_path}. Please ensure it exists.")
|
| 23 |
+
raise FileNotFoundError(f".env file not found at {env_path}")
|
| 24 |
+
|
| 25 |
+
load_dotenv(env_path)
|
| 26 |
+
|
| 27 |
+
# Required environment variables
|
| 28 |
+
REQUIRED_VARS = ['ASSEMBLYAI_API_KEY', 'ELEVENLABS_API_KEY', 'VOICE_ID']
|
| 29 |
+
|
| 30 |
+
# Load and validate environment variables
|
| 31 |
+
config = {}
|
| 32 |
+
missing_vars = []
|
| 33 |
+
|
| 34 |
+
for var in REQUIRED_VARS:
|
| 35 |
+
value = os.getenv(var)
|
| 36 |
+
if not value:
|
| 37 |
+
missing_vars.append(var)
|
| 38 |
+
config[var] = value
|
| 39 |
+
|
| 40 |
+
if missing_vars:
|
| 41 |
+
error_msg = f"Missing required environment variables: {', '.join(missing_vars)}"
|
| 42 |
+
logger.error(error_msg)
|
| 43 |
+
raise ValueError(error_msg)
|
| 44 |
+
|
| 45 |
+
# Export variables
|
| 46 |
+
ASSEMBLYAI_API_KEY = config['ASSEMBLYAI_API_KEY']
|
| 47 |
+
ELEVENLABS_API_KEY = config['ELEVENLABS_API_KEY']
|
| 48 |
+
VOICE_ID = config['VOICE_ID']
|
| 49 |
+
|
| 50 |
+
# ASSEMBLYAI_API_KEY = os.getenv("ASSEMBLYAI_API_KEY")
|
| 51 |
+
# ELEVENLABS_API_KEY = os.getenv("ELEVENLABS_API_KEY")
|
| 52 |
+
# VOICE_ID = os.getenv("VOICE_ID")
|
| 53 |
+
|
| 54 |
+
logger.info("Configuration loaded successfully")
|
| 55 |
+
logger.info("Loaded configuration values:")
|
| 56 |
+
for key, value in config.items():
|
| 57 |
+
# Mask sensitive data for logging
|
| 58 |
+
display_value = value if len(value) <= 4 else f"{value[:2]}{'*' * (len(value) - 4)}{value[-2:]}"
|
| 59 |
+
logger.info(f"{key}: {display_value}")
|
config/config.log
ADDED
|
@@ -0,0 +1,535 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2024-12-19 07:25:19,873 - __main__ - INFO - Configuration loaded successfully
|
| 2 |
+
2024-12-19 07:25:19,873 - __main__ - INFO - Loaded configuration values:
|
| 3 |
+
2024-12-19 07:25:19,873 - __main__ - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 4 |
+
2024-12-19 07:25:19,874 - __main__ - INFO - ELEVENLABS_API_KEY: sk***********************************************c8
|
| 5 |
+
2024-12-19 07:25:19,875 - __main__ - INFO - VOICE_ID: as****************S5
|
| 6 |
+
2024-12-19 07:26:20,935 - __main__ - INFO - Configuration loaded successfully
|
| 7 |
+
2024-12-19 07:26:20,936 - __main__ - INFO - Loaded configuration values:
|
| 8 |
+
2024-12-19 07:26:20,937 - __main__ - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 9 |
+
2024-12-19 07:26:20,937 - __main__ - INFO - ELEVENLABS_API_KEY: sk***********************************************c8
|
| 10 |
+
2024-12-19 07:26:20,938 - __main__ - INFO - VOICE_ID: as****************S5
|
| 11 |
+
2024-12-19 07:28:24,334 - __main__ - INFO - Configuration loaded successfully
|
| 12 |
+
2024-12-19 07:28:24,335 - __main__ - INFO - Loaded configuration values:
|
| 13 |
+
2024-12-19 07:28:24,336 - __main__ - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 14 |
+
2024-12-19 07:28:24,336 - __main__ - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 15 |
+
2024-12-19 07:28:24,336 - __main__ - INFO - VOICE_ID: as****************S5
|
| 16 |
+
2024-12-19 07:29:23,542 - config.appconfig - INFO - Configuration loaded successfully
|
| 17 |
+
2024-12-19 07:29:23,542 - config.appconfig - INFO - Loaded configuration values:
|
| 18 |
+
2024-12-19 07:29:23,543 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 19 |
+
2024-12-19 07:29:23,543 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 20 |
+
2024-12-19 07:29:23,543 - config.appconfig - INFO - VOICE_ID: as****************S5
|
| 21 |
+
2024-12-19 07:30:23,723 - config.appconfig - INFO - Configuration loaded successfully
|
| 22 |
+
2024-12-19 07:30:23,723 - config.appconfig - INFO - Loaded configuration values:
|
| 23 |
+
2024-12-19 07:30:23,724 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 24 |
+
2024-12-19 07:30:23,724 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 25 |
+
2024-12-19 07:30:23,724 - config.appconfig - INFO - VOICE_ID: as****************S5
|
| 26 |
+
2024-12-19 07:30:24,112 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 27 |
+
2024-12-19 07:30:24,980 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 28 |
+
2024-12-19 07:30:25,014 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 29 |
+
2024-12-19 07:30:25,293 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 30 |
+
2024-12-19 07:30:25,823 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 31 |
+
2024-12-19 07:30:26,557 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 32 |
+
2024-12-19 07:32:54,518 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\95b161be9a4612fdd8422c3fcf6b77a9d91aa9dfa2631f519e8d1a33bfa3714b\audio.wav
|
| 33 |
+
2024-12-19 07:32:58,791 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 34 |
+
2024-12-19 07:32:59,201 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 35 |
+
2024-12-19 07:32:59,532 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/6941e912-310e-4733-986c-7c5e11de2a92 "HTTP/1.1 200 OK"
|
| 36 |
+
2024-12-19 07:33:02,995 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/6941e912-310e-4733-986c-7c5e11de2a92 "HTTP/1.1 200 OK"
|
| 37 |
+
2024-12-19 07:33:02,996 - __main__ - INFO - Transcription completed successfully
|
| 38 |
+
2024-12-19 07:33:02,997 - __main__ - INFO - Starting text translation
|
| 39 |
+
2024-12-19 07:33:05,461 - __main__ - INFO - Translation to Russian completed
|
| 40 |
+
2024-12-19 07:33:06,825 - __main__ - INFO - Translation to Turkish completed
|
| 41 |
+
2024-12-19 07:33:08,310 - __main__ - INFO - Translation to Swedish completed
|
| 42 |
+
2024-12-19 07:33:09,796 - __main__ - INFO - Translation to German completed
|
| 43 |
+
2024-12-19 07:33:11,610 - __main__ - INFO - Translation to Spanish completed
|
| 44 |
+
2024-12-19 07:33:12,903 - __main__ - INFO - Translation to Japanese completed
|
| 45 |
+
2024-12-19 07:33:12,904 - __main__ - INFO - Starting text-to-speech conversion
|
| 46 |
+
2024-12-19 07:33:14,802 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 47 |
+
2024-12-19 07:33:14,849 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\278fd072-1300-4f87-b6ec-ddac2bd532da.mp3
|
| 48 |
+
2024-12-19 07:33:14,850 - __main__ - INFO - Starting text-to-speech conversion
|
| 49 |
+
2024-12-19 07:33:17,119 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 50 |
+
2024-12-19 07:33:17,146 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\1e992eba-00fc-4198-9d6b-e500bab558ac.mp3
|
| 51 |
+
2024-12-19 07:33:17,146 - __main__ - INFO - Starting text-to-speech conversion
|
| 52 |
+
2024-12-19 07:33:18,682 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 53 |
+
2024-12-19 07:33:18,705 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\00afb3b5-f5ea-483f-8a68-df672b0a24d2.mp3
|
| 54 |
+
2024-12-19 07:33:18,707 - __main__ - INFO - Starting text-to-speech conversion
|
| 55 |
+
2024-12-19 07:33:20,502 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 56 |
+
2024-12-19 07:33:20,539 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\ca24df5b-c19b-4fb4-8c98-ff2b20a3d206.mp3
|
| 57 |
+
2024-12-19 07:33:20,539 - __main__ - INFO - Starting text-to-speech conversion
|
| 58 |
+
2024-12-19 07:33:22,311 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 59 |
+
2024-12-19 07:33:22,346 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\213989d0-8c97-4985-b594-533684b9c19e.mp3
|
| 60 |
+
2024-12-19 07:33:22,348 - __main__ - INFO - Starting text-to-speech conversion
|
| 61 |
+
2024-12-19 07:33:24,330 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 62 |
+
2024-12-19 07:33:24,363 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\9c39b247-2682-4094-bb1f-c809a5664498.mp3
|
| 63 |
+
2024-12-19 23:39:49,467 - config.appconfig - INFO - Configuration loaded successfully
|
| 64 |
+
2024-12-19 23:39:49,467 - config.appconfig - INFO - Loaded configuration values:
|
| 65 |
+
2024-12-19 23:39:49,469 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 66 |
+
2024-12-19 23:39:49,469 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 67 |
+
2024-12-19 23:39:49,469 - config.appconfig - INFO - VOICE_ID: as****************S5
|
| 68 |
+
2024-12-19 23:39:50,391 - __main__ - INFO - VoiceTranslator initialized with extended language support
|
| 69 |
+
2024-12-19 23:39:52,145 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 70 |
+
2024-12-19 23:39:52,290 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 71 |
+
2024-12-19 23:39:52,349 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 72 |
+
2024-12-19 23:39:52,877 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 73 |
+
2024-12-19 23:39:54,593 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 74 |
+
2024-12-19 23:56:36,806 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\95b161be9a4612fdd8422c3fcf6b77a9d91aa9dfa2631f519e8d1a33bfa3714b\audio.wav
|
| 75 |
+
2024-12-19 23:56:40,239 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 76 |
+
2024-12-19 23:56:40,666 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 77 |
+
2024-12-19 23:56:41,043 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/08b199d8-dc7d-404c-8e19-a0328a43af3b "HTTP/1.1 200 OK"
|
| 78 |
+
2024-12-19 23:56:44,909 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/08b199d8-dc7d-404c-8e19-a0328a43af3b "HTTP/1.1 200 OK"
|
| 79 |
+
2024-12-19 23:56:48,292 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/08b199d8-dc7d-404c-8e19-a0328a43af3b "HTTP/1.1 200 OK"
|
| 80 |
+
2024-12-19 23:56:51,732 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/08b199d8-dc7d-404c-8e19-a0328a43af3b "HTTP/1.1 200 OK"
|
| 81 |
+
2024-12-19 23:56:55,169 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/08b199d8-dc7d-404c-8e19-a0328a43af3b "HTTP/1.1 200 OK"
|
| 82 |
+
2024-12-19 23:56:55,175 - __main__ - INFO - Transcription completed successfully
|
| 83 |
+
2024-12-19 23:56:55,175 - __main__ - INFO - Starting text translation
|
| 84 |
+
2024-12-19 23:57:01,029 - __main__ - INFO - Translation to Russian completed
|
| 85 |
+
2024-12-19 23:57:02,374 - __main__ - INFO - Translation to Turkish completed
|
| 86 |
+
2024-12-19 23:57:03,845 - __main__ - INFO - Translation to Swedish completed
|
| 87 |
+
2024-12-19 23:57:05,822 - __main__ - INFO - Translation to German completed
|
| 88 |
+
2024-12-19 23:57:07,409 - __main__ - INFO - Translation to Spanish completed
|
| 89 |
+
2024-12-19 23:57:08,841 - __main__ - INFO - Translation to Japanese completed
|
| 90 |
+
2024-12-19 23:57:08,842 - __main__ - INFO - Starting text-to-speech conversion
|
| 91 |
+
2024-12-19 23:57:11,836 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 92 |
+
2024-12-19 23:57:11,912 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\812902b2-d0b6-4eb2-8c0c-ca56e5a2a24c.mp3
|
| 93 |
+
2024-12-19 23:57:11,912 - __main__ - INFO - Starting text-to-speech conversion
|
| 94 |
+
2024-12-19 23:57:13,610 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 95 |
+
2024-12-19 23:57:13,658 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\9fc43455-d46b-4f13-9f54-1e3b39119c5a.mp3
|
| 96 |
+
2024-12-19 23:57:13,659 - __main__ - INFO - Starting text-to-speech conversion
|
| 97 |
+
2024-12-19 23:57:15,534 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 98 |
+
2024-12-19 23:57:15,567 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\55d67a14-30f0-483e-b4d8-2673196a716c.mp3
|
| 99 |
+
2024-12-19 23:57:15,568 - __main__ - INFO - Starting text-to-speech conversion
|
| 100 |
+
2024-12-19 23:57:17,524 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 101 |
+
2024-12-19 23:57:17,568 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\5b5ecea6-7fa4-4ede-a973-30ba809bdcc4.mp3
|
| 102 |
+
2024-12-19 23:57:17,570 - __main__ - INFO - Starting text-to-speech conversion
|
| 103 |
+
2024-12-19 23:57:19,546 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 104 |
+
2024-12-19 23:57:19,809 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\bc8a58f6-c961-4c47-a6f8-9c7804e6f7d1.mp3
|
| 105 |
+
2024-12-19 23:57:19,811 - __main__ - INFO - Starting text-to-speech conversion
|
| 106 |
+
2024-12-19 23:57:21,812 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/astCYLFsAfVQdrdLTbS5?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 107 |
+
2024-12-19 23:57:21,900 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpdbhfzqaw\1efef7b2-7332-4d50-b08c-fd4d46989b69.mp3
|
| 108 |
+
2024-12-21 15:24:25,509 - config.appconfig - INFO - Configuration loaded successfully
|
| 109 |
+
2024-12-21 15:24:25,509 - config.appconfig - INFO - Loaded configuration values:
|
| 110 |
+
2024-12-21 15:24:25,509 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 111 |
+
2024-12-21 15:24:25,513 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 112 |
+
2024-12-21 15:24:25,513 - config.appconfig - INFO - VOICE_ID: as****************S5
|
| 113 |
+
2024-12-21 15:24:26,294 - __main__ - INFO - VoiceTranslator initialized with extended language support
|
| 114 |
+
2024-12-21 15:24:27,849 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 115 |
+
2024-12-21 15:24:27,849 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 116 |
+
2024-12-21 15:24:27,917 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 117 |
+
2024-12-21 15:24:28,544 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 118 |
+
2024-12-21 15:24:29,955 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 119 |
+
2024-12-22 12:53:25,597 - config.appconfig - INFO - Configuration loaded successfully
|
| 120 |
+
2024-12-22 12:53:25,599 - config.appconfig - INFO - Loaded configuration values:
|
| 121 |
+
2024-12-22 12:53:25,600 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 122 |
+
2024-12-22 12:53:25,600 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 123 |
+
2024-12-22 12:53:25,600 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 124 |
+
2024-12-22 12:55:18,095 - config.appconfig - INFO - Configuration loaded successfully
|
| 125 |
+
2024-12-22 12:55:18,095 - config.appconfig - INFO - Loaded configuration values:
|
| 126 |
+
2024-12-22 12:55:18,095 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 127 |
+
2024-12-22 12:55:18,095 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 128 |
+
2024-12-22 12:55:18,095 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 129 |
+
2024-12-22 12:55:18,789 - __main__ - INFO - VoiceTranslator initialized with extended language support
|
| 130 |
+
2024-12-22 12:55:20,577 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 131 |
+
2024-12-22 12:55:20,604 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 132 |
+
2024-12-22 12:55:20,633 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 133 |
+
2024-12-22 12:55:21,238 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 134 |
+
2024-12-22 12:55:22,612 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 135 |
+
2024-12-22 13:12:01,498 - __main__ - INFO - Temporary directory cleaned up
|
| 136 |
+
2024-12-22 13:12:17,376 - config.appconfig - INFO - Configuration loaded successfully
|
| 137 |
+
2024-12-22 13:12:17,377 - config.appconfig - INFO - Loaded configuration values:
|
| 138 |
+
2024-12-22 13:12:17,377 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 139 |
+
2024-12-22 13:12:17,377 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 140 |
+
2024-12-22 13:12:17,377 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 141 |
+
2024-12-22 13:12:17,838 - __main__ - INFO - VoiceTranslator initialized with updated language support
|
| 142 |
+
2024-12-22 13:12:17,954 - __main__ - CRITICAL - Application failed to start: Audio.__init__() got an unexpected keyword argument 'sample_rate'
|
| 143 |
+
2024-12-22 13:12:19,425 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 144 |
+
2024-12-22 13:12:19,780 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 145 |
+
2024-12-22 13:12:19,955 - __main__ - INFO - Temporary directory cleaned up
|
| 146 |
+
2024-12-22 13:12:33,216 - config.appconfig - INFO - Configuration loaded successfully
|
| 147 |
+
2024-12-22 13:12:33,217 - config.appconfig - INFO - Loaded configuration values:
|
| 148 |
+
2024-12-22 13:12:33,217 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 149 |
+
2024-12-22 13:12:33,217 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 150 |
+
2024-12-22 13:12:33,218 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 151 |
+
2024-12-22 13:12:33,734 - __main__ - INFO - VoiceTranslator initialized with updated language support
|
| 152 |
+
2024-12-22 13:12:33,860 - __main__ - CRITICAL - Application failed to start: Audio.__init__() got an unexpected keyword argument 'sample_rate'
|
| 153 |
+
2024-12-22 13:12:35,424 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 154 |
+
2024-12-22 13:12:35,780 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 155 |
+
2024-12-22 13:12:37,802 - __main__ - INFO - Temporary directory cleaned up
|
| 156 |
+
2024-12-22 13:13:37,542 - config.appconfig - INFO - Configuration loaded successfully
|
| 157 |
+
2024-12-22 13:13:37,542 - config.appconfig - INFO - Loaded configuration values:
|
| 158 |
+
2024-12-22 13:13:37,542 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 159 |
+
2024-12-22 13:13:37,543 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 160 |
+
2024-12-22 13:13:37,543 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 161 |
+
2024-12-22 13:13:37,966 - __main__ - INFO - VoiceTranslator initialized with updated language support
|
| 162 |
+
2024-12-22 13:13:39,468 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 163 |
+
2024-12-22 13:13:39,528 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 164 |
+
2024-12-22 13:13:39,719 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 165 |
+
2024-12-22 13:13:40,236 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 166 |
+
2024-12-22 13:13:41,335 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 167 |
+
2024-12-22 13:16:15,697 - config.appconfig - INFO - Configuration loaded successfully
|
| 168 |
+
2024-12-22 13:16:15,697 - config.appconfig - INFO - Loaded configuration values:
|
| 169 |
+
2024-12-22 13:16:15,697 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 170 |
+
2024-12-22 13:16:15,698 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 171 |
+
2024-12-22 13:16:15,698 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 172 |
+
2024-12-22 13:16:16,286 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 173 |
+
2024-12-22 13:16:17,487 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 174 |
+
2024-12-22 13:16:17,532 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 175 |
+
2024-12-22 13:16:17,773 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 176 |
+
2024-12-22 13:16:18,248 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 177 |
+
2024-12-22 13:16:19,331 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 178 |
+
2024-12-22 13:25:56,057 - __main__ - INFO - Temporary directory cleaned up successfully
|
| 179 |
+
2024-12-22 13:26:03,090 - config.appconfig - INFO - Configuration loaded successfully
|
| 180 |
+
2024-12-22 13:26:03,091 - config.appconfig - INFO - Loaded configuration values:
|
| 181 |
+
2024-12-22 13:26:03,091 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 182 |
+
2024-12-22 13:26:03,091 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 183 |
+
2024-12-22 13:26:03,091 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 184 |
+
2024-12-22 13:26:03,394 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 185 |
+
2024-12-22 13:26:04,565 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 186 |
+
2024-12-22 13:26:04,591 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 187 |
+
2024-12-22 13:26:04,610 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 188 |
+
2024-12-22 13:26:05,157 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 189 |
+
2024-12-22 13:26:06,270 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 190 |
+
2024-12-22 13:30:54,008 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\2cb3542f4f5f0c0e79886c3eb59aeb70c1789b882163c84feb5a8bffb86875ee\audio.wav
|
| 191 |
+
2024-12-22 13:32:30,504 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 192 |
+
2024-12-22 13:32:30,978 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 193 |
+
2024-12-22 13:32:31,444 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/1a9dab80-ff87-469c-a556-b64d4533d792 "HTTP/1.1 200 OK"
|
| 194 |
+
2024-12-22 13:32:35,264 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/1a9dab80-ff87-469c-a556-b64d4533d792 "HTTP/1.1 200 OK"
|
| 195 |
+
2024-12-22 13:32:39,024 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/1a9dab80-ff87-469c-a556-b64d4533d792 "HTTP/1.1 200 OK"
|
| 196 |
+
2024-12-22 13:32:39,710 - __main__ - INFO - Transcription completed successfully
|
| 197 |
+
2024-12-22 13:32:39,713 - __main__ - INFO - Starting text translation
|
| 198 |
+
2024-12-22 13:32:48,889 - __main__ - INFO - Translation to Arabic completed
|
| 199 |
+
2024-12-22 13:32:55,260 - __main__ - INFO - Translation to Chinese completed
|
| 200 |
+
2024-12-22 13:33:03,943 - __main__ - INFO - Translation to Dutch completed
|
| 201 |
+
2024-12-22 13:33:03,943 - __main__ - INFO - Translation to English completed
|
| 202 |
+
2024-12-22 13:33:11,913 - __main__ - INFO - Translation to French completed
|
| 203 |
+
2024-12-22 13:33:19,203 - __main__ - INFO - Translation to German completed
|
| 204 |
+
2024-12-22 13:33:24,941 - __main__ - INFO - Translation to Hindi completed
|
| 205 |
+
2024-12-22 13:33:31,489 - __main__ - INFO - Translation to Italian completed
|
| 206 |
+
2024-12-22 13:33:36,708 - __main__ - INFO - Translation to Japanese completed
|
| 207 |
+
2024-12-22 13:33:44,073 - __main__ - ERROR - Error translating to Korean: generator raised StopIteration
|
| 208 |
+
2024-12-22 13:33:48,700 - __main__ - INFO - Translation to Portuguese completed
|
| 209 |
+
2024-12-22 13:33:53,370 - __main__ - INFO - Translation to Russian completed
|
| 210 |
+
2024-12-22 13:33:58,616 - __main__ - INFO - Translation to Spanish completed
|
| 211 |
+
2024-12-22 13:34:05,580 - __main__ - ERROR - Error translating to Swedish: generator raised StopIteration
|
| 212 |
+
2024-12-22 13:34:12,547 - __main__ - INFO - Translation to Turkish completed
|
| 213 |
+
2024-12-22 13:34:18,140 - __main__ - INFO - Translation to Ukrainian completed
|
| 214 |
+
2024-12-22 13:34:18,141 - __main__ - INFO - Starting text-to-speech conversion
|
| 215 |
+
2024-12-22 13:34:29,024 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 216 |
+
2024-12-22 13:34:29,308 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\3d3a67e7-cfef-4a29-94fc-9b1af144b37e.mp3
|
| 217 |
+
2024-12-22 13:34:29,308 - __main__ - INFO - Starting text-to-speech conversion
|
| 218 |
+
2024-12-22 13:34:36,059 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 219 |
+
2024-12-22 13:34:36,081 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\b9c3fa04-1ed4-4991-9188-b18853e4591c.mp3
|
| 220 |
+
2024-12-22 13:34:36,082 - __main__ - INFO - Starting text-to-speech conversion
|
| 221 |
+
2024-12-22 13:34:46,640 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 222 |
+
2024-12-22 13:34:46,730 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\4eea6f54-aa93-44dd-b8b6-2c438124db7c.mp3
|
| 223 |
+
2024-12-22 13:34:46,731 - __main__ - INFO - Starting text-to-speech conversion
|
| 224 |
+
2024-12-22 13:35:32,384 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 225 |
+
2024-12-22 13:35:32,547 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\de74c9fb-54fe-456c-b461-685d1c6933f9.mp3
|
| 226 |
+
2024-12-22 13:35:32,548 - __main__ - INFO - Starting text-to-speech conversion
|
| 227 |
+
2024-12-22 13:35:41,658 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 228 |
+
2024-12-22 13:35:41,682 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\0c09fc81-78d7-4745-9263-c115e46bc8fb.mp3
|
| 229 |
+
2024-12-22 13:35:41,683 - __main__ - INFO - Starting text-to-speech conversion
|
| 230 |
+
2024-12-22 13:35:50,351 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 231 |
+
2024-12-22 13:35:50,395 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\10e51b45-e9e3-48ae-8764-e93998ff4564.mp3
|
| 232 |
+
2024-12-22 13:35:50,397 - __main__ - INFO - Starting text-to-speech conversion
|
| 233 |
+
2024-12-22 13:35:56,113 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 234 |
+
2024-12-22 13:35:56,145 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\7e1d15cb-2f4e-4e8d-93d7-04684bc8303a.mp3
|
| 235 |
+
2024-12-22 13:35:56,148 - __main__ - INFO - Starting text-to-speech conversion
|
| 236 |
+
2024-12-22 13:36:05,018 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 237 |
+
2024-12-22 13:36:05,056 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\39c00821-bdd6-4c13-b8ab-d86828b0a6f3.mp3
|
| 238 |
+
2024-12-22 13:36:05,057 - __main__ - INFO - Starting text-to-speech conversion
|
| 239 |
+
2024-12-22 13:36:11,167 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 240 |
+
2024-12-22 13:36:11,181 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\9c9fc0ef-1914-4ec4-8cb7-3fe1ea84b8a5.mp3
|
| 241 |
+
2024-12-22 13:36:11,181 - __main__ - INFO - Starting text-to-speech conversion
|
| 242 |
+
2024-12-22 13:37:00,057 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 243 |
+
2024-12-22 13:37:00,209 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\056ea824-4e9b-454b-b13d-2d3bfcd8fc3e.mp3
|
| 244 |
+
2024-12-22 13:37:00,209 - __main__ - INFO - Starting text-to-speech conversion
|
| 245 |
+
2024-12-22 13:37:09,337 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 246 |
+
2024-12-22 13:37:09,470 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\279167d6-17fd-4917-85ab-074b205011d5.mp3
|
| 247 |
+
2024-12-22 13:37:09,471 - __main__ - INFO - Starting text-to-speech conversion
|
| 248 |
+
2024-12-22 13:37:17,335 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 249 |
+
2024-12-22 13:37:17,401 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\e8855f8f-e381-4e51-a011-b8f4321aaa5f.mp3
|
| 250 |
+
2024-12-22 13:37:17,401 - __main__ - INFO - Starting text-to-speech conversion
|
| 251 |
+
2024-12-22 13:37:26,623 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 252 |
+
2024-12-22 13:37:26,632 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\68089bf6-3b26-4594-a93d-d8b8d90335cd.mp3
|
| 253 |
+
2024-12-22 13:37:26,632 - __main__ - INFO - Starting text-to-speech conversion
|
| 254 |
+
2024-12-22 13:38:14,935 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 255 |
+
2024-12-22 13:38:15,082 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\38b7d72b-07b9-49cb-983c-ea01d7566076.mp3
|
| 256 |
+
2024-12-22 13:38:15,084 - __main__ - INFO - Starting text-to-speech conversion
|
| 257 |
+
2024-12-22 13:38:22,345 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 258 |
+
2024-12-22 13:38:22,383 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\9cc6cc7b-3f51-48fc-84b8-44c0b92f62f2.mp3
|
| 259 |
+
2024-12-22 13:38:22,384 - __main__ - INFO - Starting text-to-speech conversion
|
| 260 |
+
2024-12-22 13:38:28,056 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 261 |
+
2024-12-22 13:38:28,074 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpyc3_6rrs\46b018d3-c49f-4689-9932-4e690cbeecaa.mp3
|
| 262 |
+
2024-12-22 15:47:42,018 - __main__ - INFO - Temporary directory cleaned up successfully
|
| 263 |
+
2024-12-22 15:47:55,621 - config.appconfig - INFO - Configuration loaded successfully
|
| 264 |
+
2024-12-22 15:47:55,623 - config.appconfig - INFO - Loaded configuration values:
|
| 265 |
+
2024-12-22 15:47:55,625 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 266 |
+
2024-12-22 15:47:55,625 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 267 |
+
2024-12-22 15:47:55,625 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 268 |
+
2024-12-22 15:47:56,201 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 269 |
+
2024-12-22 15:47:57,469 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 270 |
+
2024-12-22 15:47:57,517 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 271 |
+
2024-12-22 15:47:57,778 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 272 |
+
2024-12-22 15:47:58,590 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 273 |
+
2024-12-22 15:47:59,078 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 274 |
+
2024-12-22 15:49:13,850 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\e3c89e395f61d78e1bfb76cc8b693ce46b3d7fe396150157c9ad913388cd40f2\audio.wav
|
| 275 |
+
2024-12-22 15:49:22,054 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 276 |
+
2024-12-22 15:49:22,678 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 277 |
+
2024-12-22 15:49:23,088 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/ad651ec7-5430-487c-9926-c700f72bfa1a "HTTP/1.1 200 OK"
|
| 278 |
+
2024-12-22 15:49:26,552 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/ad651ec7-5430-487c-9926-c700f72bfa1a "HTTP/1.1 200 OK"
|
| 279 |
+
2024-12-22 15:49:26,566 - __main__ - INFO - Transcription completed successfully
|
| 280 |
+
2024-12-22 15:49:26,568 - __main__ - INFO - Starting text translation
|
| 281 |
+
2024-12-22 15:49:31,519 - __main__ - INFO - Translation to Arabic completed
|
| 282 |
+
2024-12-22 15:49:32,998 - __main__ - INFO - Translation to Chinese completed
|
| 283 |
+
2024-12-22 15:49:35,259 - __main__ - INFO - Translation to French completed
|
| 284 |
+
2024-12-22 15:49:36,691 - __main__ - INFO - Translation to Russian completed
|
| 285 |
+
2024-12-22 15:49:36,691 - __main__ - INFO - Starting text-to-speech conversion
|
| 286 |
+
2024-12-22 15:49:40,725 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 287 |
+
2024-12-22 15:49:41,111 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpulfodocp\67f42115-19fb-4ead-91bb-60f6c16a7645.mp3
|
| 288 |
+
2024-12-22 15:49:41,114 - __main__ - INFO - Starting text-to-speech conversion
|
| 289 |
+
2024-12-22 15:49:43,265 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 290 |
+
2024-12-22 15:49:43,432 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpulfodocp\f3c3809d-d82b-458d-af6a-e417d416f8be.mp3
|
| 291 |
+
2024-12-22 15:49:43,436 - __main__ - INFO - Starting text-to-speech conversion
|
| 292 |
+
2024-12-22 15:49:45,797 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 293 |
+
2024-12-22 15:49:45,926 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpulfodocp\a0021ab3-8d5b-47df-9695-176fe639d812.mp3
|
| 294 |
+
2024-12-22 15:49:45,926 - __main__ - INFO - Starting text-to-speech conversion
|
| 295 |
+
2024-12-22 15:49:48,069 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 296 |
+
2024-12-22 15:49:48,155 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpulfodocp\24656f71-903f-49d2-931c-68a2a8df65ec.mp3
|
| 297 |
+
2024-12-22 15:53:51,829 - __main__ - INFO - Temporary directory cleaned up successfully
|
| 298 |
+
2024-12-22 15:54:07,764 - config.appconfig - INFO - Configuration loaded successfully
|
| 299 |
+
2024-12-22 15:54:07,764 - config.appconfig - INFO - Loaded configuration values:
|
| 300 |
+
2024-12-22 15:54:07,764 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 301 |
+
2024-12-22 15:54:07,767 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 302 |
+
2024-12-22 15:54:07,767 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 303 |
+
2024-12-22 15:54:08,450 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 304 |
+
2024-12-22 15:54:09,905 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 305 |
+
2024-12-22 15:54:09,977 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 306 |
+
2024-12-22 15:54:10,209 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 307 |
+
2024-12-22 15:54:10,625 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 308 |
+
2024-12-22 15:54:12,973 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 309 |
+
2024-12-22 17:33:50,462 - __main__ - INFO - Temporary directory cleaned up successfully
|
| 310 |
+
2024-12-22 17:34:49,102 - config.appconfig - INFO - Configuration loaded successfully
|
| 311 |
+
2024-12-22 17:34:49,102 - config.appconfig - INFO - Loaded configuration values:
|
| 312 |
+
2024-12-22 17:34:49,102 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 313 |
+
2024-12-22 17:34:49,102 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 314 |
+
2024-12-22 17:34:49,107 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 315 |
+
2024-12-22 17:34:49,428 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 316 |
+
2024-12-22 17:34:50,168 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 317 |
+
2024-12-22 17:34:50,344 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 318 |
+
2024-12-22 17:34:50,719 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 319 |
+
2024-12-22 17:34:51,292 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 320 |
+
2024-12-22 17:34:52,208 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 321 |
+
2024-12-22 17:42:28,840 - __main__ - INFO - Temporary directory cleaned up successfully
|
| 322 |
+
2024-12-22 17:42:41,607 - config.appconfig - INFO - Configuration loaded successfully
|
| 323 |
+
2024-12-22 17:42:41,607 - config.appconfig - INFO - Loaded configuration values:
|
| 324 |
+
2024-12-22 17:42:41,607 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 325 |
+
2024-12-22 17:42:41,607 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 326 |
+
2024-12-22 17:42:41,607 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 327 |
+
2024-12-22 17:42:42,140 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 328 |
+
2024-12-22 17:42:42,957 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 329 |
+
2024-12-22 17:42:43,102 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 330 |
+
2024-12-22 17:42:43,522 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 331 |
+
2024-12-22 17:42:44,034 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 332 |
+
2024-12-22 17:42:44,919 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 333 |
+
2024-12-22 17:44:20,225 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\9ace849f25515e1d656eb0628dbe675dd52a1109514d67318f8509b010bc5393\audio.wav
|
| 334 |
+
2024-12-22 17:44:30,786 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 335 |
+
2024-12-22 17:44:31,456 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 336 |
+
2024-12-22 17:44:31,818 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/1f0eed16-f0b5-4b1e-91f3-b945de2bed74 "HTTP/1.1 200 OK"
|
| 337 |
+
2024-12-22 17:44:35,282 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/1f0eed16-f0b5-4b1e-91f3-b945de2bed74 "HTTP/1.1 200 OK"
|
| 338 |
+
2024-12-22 17:44:35,292 - __main__ - INFO - Transcription completed successfully
|
| 339 |
+
2024-12-22 17:44:35,292 - __main__ - INFO - Starting text translation
|
| 340 |
+
2024-12-22 17:44:40,770 - __main__ - INFO - Translation to Arabic completed
|
| 341 |
+
2024-12-22 17:44:42,690 - __main__ - INFO - Translation to Chinese completed
|
| 342 |
+
2024-12-22 17:44:44,571 - __main__ - INFO - Translation to Japanese completed
|
| 343 |
+
2024-12-22 17:44:46,488 - __main__ - INFO - Translation to Korean completed
|
| 344 |
+
2024-12-22 17:44:48,452 - __main__ - INFO - Translation to Russian completed
|
| 345 |
+
2024-12-22 17:44:48,453 - __main__ - INFO - Starting text-to-speech conversion
|
| 346 |
+
2024-12-22 17:44:53,417 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 347 |
+
2024-12-22 17:44:53,932 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp5ilel9yb\68df2127-d377-494f-9525-b49bc945b547.mp3
|
| 348 |
+
2024-12-22 17:44:53,932 - __main__ - INFO - Starting text-to-speech conversion
|
| 349 |
+
2024-12-22 17:44:57,592 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 350 |
+
2024-12-22 17:44:57,832 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp5ilel9yb\02c716d0-b199-490f-8f46-57b7ebbdba87.mp3
|
| 351 |
+
2024-12-22 17:44:57,834 - __main__ - INFO - Starting text-to-speech conversion
|
| 352 |
+
2024-12-22 17:45:01,216 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 353 |
+
2024-12-22 17:45:01,316 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp5ilel9yb\011a8288-46c7-4c1f-ade6-539e42cb74d4.mp3
|
| 354 |
+
2024-12-22 17:45:01,320 - __main__ - INFO - Starting text-to-speech conversion
|
| 355 |
+
2024-12-22 17:45:05,196 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 356 |
+
2024-12-22 17:45:05,548 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp5ilel9yb\408cd49f-c5d1-4f3f-90ec-b5bbbf120324.mp3
|
| 357 |
+
2024-12-22 17:45:05,549 - __main__ - INFO - Starting text-to-speech conversion
|
| 358 |
+
2024-12-22 17:45:09,427 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 359 |
+
2024-12-22 17:45:09,530 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp5ilel9yb\07e527ca-0d7d-4339-bc37-a2c7fe5806ae.mp3
|
| 360 |
+
2024-12-22 17:51:00,028 - config.appconfig - INFO - Configuration loaded successfully
|
| 361 |
+
2024-12-22 17:51:00,028 - config.appconfig - INFO - Loaded configuration values:
|
| 362 |
+
2024-12-22 17:51:00,032 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 363 |
+
2024-12-22 17:51:00,032 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 364 |
+
2024-12-22 17:51:00,033 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 365 |
+
2024-12-22 17:51:00,540 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 366 |
+
2024-12-22 17:51:01,532 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7862/startup-events "HTTP/1.1 200 OK"
|
| 367 |
+
2024-12-22 17:51:01,610 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7862/ "HTTP/1.1 200 OK"
|
| 368 |
+
2024-12-22 17:51:01,902 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 369 |
+
2024-12-22 17:51:02,508 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 370 |
+
2024-12-22 17:51:03,469 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 371 |
+
2024-12-22 17:52:42,625 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\264f7f2499b7034302f3a414139f5debeda824ccef18168b63aed422c7fa3596\audio.wav
|
| 372 |
+
2024-12-22 17:52:51,365 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 373 |
+
2024-12-22 17:52:51,748 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 374 |
+
2024-12-22 17:52:52,290 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/60c41c62-55e0-4d75-abcf-dfbfcfe81dc7 "HTTP/1.1 200 OK"
|
| 375 |
+
2024-12-22 17:52:55,880 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/60c41c62-55e0-4d75-abcf-dfbfcfe81dc7 "HTTP/1.1 200 OK"
|
| 376 |
+
2024-12-22 17:52:55,880 - __main__ - INFO - Transcription completed successfully
|
| 377 |
+
2024-12-22 17:52:55,880 - __main__ - INFO - Starting text translation
|
| 378 |
+
2024-12-22 17:53:05,773 - __main__ - INFO - Translation to Arabic completed
|
| 379 |
+
2024-12-22 17:53:07,298 - __main__ - INFO - Translation to Chinese completed
|
| 380 |
+
2024-12-22 17:53:09,294 - __main__ - INFO - Translation to French completed
|
| 381 |
+
2024-12-22 17:53:10,738 - __main__ - INFO - Translation to Japanese completed
|
| 382 |
+
2024-12-22 17:53:12,350 - __main__ - INFO - Translation to Korean completed
|
| 383 |
+
2024-12-22 17:53:13,910 - __main__ - INFO - Translation to Russian completed
|
| 384 |
+
2024-12-22 17:53:13,910 - __main__ - INFO - Starting text-to-speech conversion
|
| 385 |
+
2024-12-22 17:53:19,662 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 386 |
+
2024-12-22 17:53:19,903 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpz0i2o105\61f8031d-05e6-4c97-8ebe-b59a8739b717.mp3
|
| 387 |
+
2024-12-22 17:53:19,905 - __main__ - INFO - Starting text-to-speech conversion
|
| 388 |
+
2024-12-22 17:53:23,295 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 389 |
+
2024-12-22 17:53:23,396 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpz0i2o105\bd0299dd-11a2-421d-9d77-87a1ea89a564.mp3
|
| 390 |
+
2024-12-22 17:53:23,398 - __main__ - INFO - Starting text-to-speech conversion
|
| 391 |
+
2024-12-22 17:53:27,002 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 392 |
+
2024-12-22 17:53:27,064 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpz0i2o105\eeefed3a-99fc-4658-8465-cbae8c55d86e.mp3
|
| 393 |
+
2024-12-22 17:53:27,064 - __main__ - INFO - Starting text-to-speech conversion
|
| 394 |
+
2024-12-22 17:53:30,782 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 395 |
+
2024-12-22 17:53:30,853 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpz0i2o105\c4160321-afff-4d12-947e-0eca55c4668f.mp3
|
| 396 |
+
2024-12-22 17:53:30,855 - __main__ - INFO - Starting text-to-speech conversion
|
| 397 |
+
2024-12-22 17:53:34,270 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 398 |
+
2024-12-22 17:53:34,293 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpz0i2o105\83438421-50e7-41ec-9b3d-22f3d94d0c43.mp3
|
| 399 |
+
2024-12-22 17:53:34,293 - __main__ - INFO - Starting text-to-speech conversion
|
| 400 |
+
2024-12-22 17:53:38,049 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 401 |
+
2024-12-22 17:53:38,120 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpz0i2o105\21695df2-763c-496b-8290-a03e59bafbdd.mp3
|
| 402 |
+
2024-12-22 17:57:16,992 - __main__ - INFO - Temporary directory cleaned up successfully
|
| 403 |
+
2024-12-22 17:57:33,988 - config.appconfig - INFO - Configuration loaded successfully
|
| 404 |
+
2024-12-22 17:57:33,988 - config.appconfig - INFO - Loaded configuration values:
|
| 405 |
+
2024-12-22 17:57:33,988 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 406 |
+
2024-12-22 17:57:33,988 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 407 |
+
2024-12-22 17:57:33,988 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 408 |
+
2024-12-22 17:57:34,652 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 409 |
+
2024-12-22 17:57:36,326 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7862/startup-events "HTTP/1.1 200 OK"
|
| 410 |
+
2024-12-22 17:57:36,409 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7862/ "HTTP/1.1 200 OK"
|
| 411 |
+
2024-12-22 17:57:36,753 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 412 |
+
2024-12-22 17:57:37,056 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 413 |
+
2024-12-22 17:57:38,640 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 414 |
+
2024-12-22 17:58:50,005 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\b5f9fdeba9a3c0dc0dac34608d139192967008712190dc60d9a75e8e9a6eefb4\audio.wav
|
| 415 |
+
2024-12-22 17:59:03,201 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 416 |
+
2024-12-22 17:59:03,794 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 417 |
+
2024-12-22 17:59:04,203 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/dfe09937-b53c-4f8a-af36-1dd0d85b0ae3 "HTTP/1.1 200 OK"
|
| 418 |
+
2024-12-22 17:59:07,682 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/dfe09937-b53c-4f8a-af36-1dd0d85b0ae3 "HTTP/1.1 200 OK"
|
| 419 |
+
2024-12-22 17:59:07,682 - __main__ - INFO - Transcription completed successfully
|
| 420 |
+
2024-12-22 17:59:07,682 - __main__ - INFO - Starting text translation
|
| 421 |
+
2024-12-22 17:59:11,475 - __main__ - INFO - Translation to Arabic completed
|
| 422 |
+
2024-12-22 17:59:13,681 - __main__ - INFO - Translation to Chinese completed
|
| 423 |
+
2024-12-22 17:59:15,331 - __main__ - INFO - Translation to French completed
|
| 424 |
+
2024-12-22 17:59:17,580 - __main__ - INFO - Translation to Japanese completed
|
| 425 |
+
2024-12-22 17:59:19,454 - __main__ - INFO - Translation to Korean completed
|
| 426 |
+
2024-12-22 17:59:21,430 - __main__ - INFO - Translation to Russian completed
|
| 427 |
+
2024-12-22 17:59:21,430 - __main__ - INFO - Starting text-to-speech conversion
|
| 428 |
+
2024-12-22 17:59:27,340 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 429 |
+
2024-12-22 17:59:27,552 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp0aa0mcvd\202ec329-e637-4736-abe0-38c581030c3f.mp3
|
| 430 |
+
2024-12-22 17:59:27,552 - __main__ - INFO - Starting text-to-speech conversion
|
| 431 |
+
2024-12-22 17:59:32,360 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 432 |
+
2024-12-22 17:59:32,432 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp0aa0mcvd\02afd306-efaa-43fc-9022-e5d73668a9cd.mp3
|
| 433 |
+
2024-12-22 17:59:32,432 - __main__ - INFO - Starting text-to-speech conversion
|
| 434 |
+
2024-12-22 17:59:37,689 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 435 |
+
2024-12-22 17:59:37,725 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp0aa0mcvd\8fc2b875-d56a-4022-85bc-46d3e99dfb41.mp3
|
| 436 |
+
2024-12-22 17:59:37,733 - __main__ - INFO - Starting text-to-speech conversion
|
| 437 |
+
2024-12-22 17:59:42,190 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 438 |
+
2024-12-22 17:59:42,267 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp0aa0mcvd\29f013fc-f6fe-4c9f-9bcc-dbff08db018f.mp3
|
| 439 |
+
2024-12-22 17:59:42,268 - __main__ - INFO - Starting text-to-speech conversion
|
| 440 |
+
2024-12-22 17:59:45,778 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 441 |
+
2024-12-22 17:59:45,815 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp0aa0mcvd\2c04ab89-9412-438d-a338-e08ab9efeb7a.mp3
|
| 442 |
+
2024-12-22 17:59:45,815 - __main__ - INFO - Starting text-to-speech conversion
|
| 443 |
+
2024-12-22 17:59:49,350 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 444 |
+
2024-12-22 17:59:49,471 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmp0aa0mcvd\4599b361-5d1d-41bf-a915-7b77b6104e7c.mp3
|
| 445 |
+
2024-12-22 18:07:25,755 - config.appconfig - INFO - Configuration loaded successfully
|
| 446 |
+
2024-12-22 18:07:25,755 - config.appconfig - INFO - Loaded configuration values:
|
| 447 |
+
2024-12-22 18:07:25,755 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 448 |
+
2024-12-22 18:07:25,759 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 449 |
+
2024-12-22 18:07:25,759 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 450 |
+
2024-12-22 18:07:26,390 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 451 |
+
2024-12-22 18:07:27,908 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 452 |
+
2024-12-22 18:07:28,043 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 453 |
+
2024-12-22 18:07:28,166 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 454 |
+
2024-12-22 18:07:28,340 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 455 |
+
2024-12-22 18:07:30,260 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 456 |
+
2024-12-22 18:13:04,898 - __main__ - INFO - Temporary directory cleaned up successfully
|
| 457 |
+
2024-12-22 18:13:17,791 - config.appconfig - INFO - Configuration loaded successfully
|
| 458 |
+
2024-12-22 18:13:17,791 - config.appconfig - INFO - Loaded configuration values:
|
| 459 |
+
2024-12-22 18:13:17,793 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 460 |
+
2024-12-22 18:13:17,793 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 461 |
+
2024-12-22 18:13:17,795 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 462 |
+
2024-12-22 18:13:18,492 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 463 |
+
2024-12-22 18:13:19,628 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 464 |
+
2024-12-22 18:13:19,671 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 465 |
+
2024-12-22 18:13:19,867 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 466 |
+
2024-12-22 18:13:20,437 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 467 |
+
2024-12-22 18:13:21,691 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
|
| 468 |
+
2024-12-22 18:14:48,881 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\8e2ca83b8e21a4dde93d90155b06c3b51d791c61f427aae6ede145ca8169ca18\audio.wav
|
| 469 |
+
2024-12-22 18:14:53,856 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 470 |
+
2024-12-22 18:14:54,258 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 471 |
+
2024-12-22 18:14:54,677 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/add1b68f-d1a9-4c00-895a-4b0da8c2d71f "HTTP/1.1 200 OK"
|
| 472 |
+
2024-12-22 18:14:58,217 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/add1b68f-d1a9-4c00-895a-4b0da8c2d71f "HTTP/1.1 200 OK"
|
| 473 |
+
2024-12-22 18:14:58,221 - __main__ - INFO - Transcription completed successfully
|
| 474 |
+
2024-12-22 18:14:58,221 - __main__ - INFO - Starting text translation
|
| 475 |
+
2024-12-22 18:15:02,177 - __main__ - INFO - Translation to Arabic completed
|
| 476 |
+
2024-12-22 18:15:04,608 - __main__ - INFO - Translation to Chinese completed
|
| 477 |
+
2024-12-22 18:15:06,968 - __main__ - INFO - Translation to Italian completed
|
| 478 |
+
2024-12-22 18:15:08,705 - __main__ - INFO - Translation to Japanese completed
|
| 479 |
+
2024-12-22 18:15:10,647 - __main__ - INFO - Translation to Korean completed
|
| 480 |
+
2024-12-22 18:15:10,650 - __main__ - INFO - Starting text-to-speech conversion
|
| 481 |
+
2024-12-22 18:15:13,416 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 482 |
+
2024-12-22 18:15:13,509 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpk8m2dd1o\a5b29477-8c77-4400-895c-5f83db0b16e2.mp3
|
| 483 |
+
2024-12-22 18:15:13,509 - __main__ - INFO - Starting text-to-speech conversion
|
| 484 |
+
2024-12-22 18:15:14,691 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 485 |
+
2024-12-22 18:15:14,709 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpk8m2dd1o\a0276f11-d4dc-4875-b0d3-2a1a34afdc73.mp3
|
| 486 |
+
2024-12-22 18:15:14,709 - __main__ - INFO - Starting text-to-speech conversion
|
| 487 |
+
2024-12-22 18:15:16,181 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 488 |
+
2024-12-22 18:15:16,379 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpk8m2dd1o\9b545dc2-549d-4d75-ba2b-2b52c6f0a06f.mp3
|
| 489 |
+
2024-12-22 18:15:16,384 - __main__ - INFO - Starting text-to-speech conversion
|
| 490 |
+
2024-12-22 18:15:17,624 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 491 |
+
2024-12-22 18:15:17,630 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpk8m2dd1o\b9a4208b-466d-4309-b394-6774fee073ba.mp3
|
| 492 |
+
2024-12-22 18:15:17,630 - __main__ - INFO - Starting text-to-speech conversion
|
| 493 |
+
2024-12-22 18:15:19,107 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 494 |
+
2024-12-22 18:15:19,111 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmpk8m2dd1o\1f18c746-1e7e-4775-aeb6-4b96409a3fa0.mp3
|
| 495 |
+
2024-12-22 18:18:40,776 - config.appconfig - INFO - Configuration loaded successfully
|
| 496 |
+
2024-12-22 18:18:40,776 - config.appconfig - INFO - Loaded configuration values:
|
| 497 |
+
2024-12-22 18:18:40,776 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 498 |
+
2024-12-22 18:18:40,776 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 499 |
+
2024-12-22 18:18:40,776 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 500 |
+
2024-12-22 18:18:42,083 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 501 |
+
2024-12-22 18:18:42,161 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 502 |
+
2024-12-22 18:18:44,764 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 503 |
+
2024-12-22 18:18:45,877 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 504 |
+
2024-12-22 18:19:30,485 - config.appconfig - INFO - Configuration loaded successfully
|
| 505 |
+
2024-12-22 18:19:30,494 - config.appconfig - INFO - Loaded configuration values:
|
| 506 |
+
2024-12-22 18:19:30,498 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 507 |
+
2024-12-22 18:19:30,501 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 508 |
+
2024-12-22 18:19:30,503 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 509 |
+
2024-12-22 18:19:31,596 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7861/startup-events "HTTP/1.1 200 OK"
|
| 510 |
+
2024-12-22 18:19:31,650 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7861/ "HTTP/1.1 200 OK"
|
| 511 |
+
2024-12-22 18:19:32,176 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 512 |
+
2024-12-22 18:19:32,553 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 513 |
+
2024-12-22 18:19:32,891 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 514 |
+
2024-12-22 18:20:28,148 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 515 |
+
2024-12-22 18:20:28,526 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 516 |
+
2024-12-22 18:20:28,894 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/dcf1618c-e4ab-4ba4-a412-d1a00ee10956 "HTTP/1.1 200 OK"
|
| 517 |
+
2024-12-22 18:20:32,294 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/dcf1618c-e4ab-4ba4-a412-d1a00ee10956 "HTTP/1.1 200 OK"
|
| 518 |
+
2024-12-22 18:20:52,868 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 519 |
+
2024-12-22 18:20:55,796 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 520 |
+
2024-12-22 18:20:59,531 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 521 |
+
2024-12-22 18:21:02,559 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 522 |
+
2024-12-22 18:21:05,782 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 523 |
+
2024-12-22 18:21:09,366 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 524 |
+
2024-12-23 08:42:12,135 - config.appconfig - INFO - Configuration loaded successfully
|
| 525 |
+
2024-12-23 08:42:12,141 - config.appconfig - INFO - Loaded configuration values:
|
| 526 |
+
2024-12-23 08:42:12,141 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 527 |
+
2024-12-23 08:42:12,144 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 528 |
+
2024-12-23 08:42:12,144 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 529 |
+
2024-12-23 08:43:46,689 - config.appconfig - INFO - Configuration loaded successfully
|
| 530 |
+
2024-12-23 08:43:46,689 - config.appconfig - INFO - Loaded configuration values:
|
| 531 |
+
2024-12-23 08:43:46,689 - config.appconfig - INFO - ASSEMBLYAI_API_KEY: b4****************************7a
|
| 532 |
+
2024-12-23 08:43:46,692 - config.appconfig - INFO - ELEVENLABS_API_KEY: sk***********************************************86
|
| 533 |
+
2024-12-23 08:43:46,692 - config.appconfig - INFO - VOICE_ID: X8****************bQ
|
| 534 |
+
2024-12-23 08:43:48,575 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 535 |
+
2024-12-23 08:43:48,665 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
logs/voice_translator.log
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2024-12-19 00:10:29,561 - __main__ - CRITICAL - Application failed to start: No module named 'config'
|
| 2 |
+
2024-12-19 00:10:29,588 - httpx - INFO - HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
|
| 3 |
+
2024-12-19 00:11:55,463 - __main__ - CRITICAL - Application failed to start: No module named 'config'
|
| 4 |
+
2024-12-19 23:38:29,383 - __main__ - CRITICAL - Application failed to start: No module named 'config'
|
| 5 |
+
2024-12-23 09:18:22,049 - __main__ - INFO - VoiceTranslator initialized successfully
|
| 6 |
+
2024-12-23 09:18:23,243 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/startup-events "HTTP/1.1 200 OK"
|
| 7 |
+
2024-12-23 09:18:23,302 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 8 |
+
2024-12-23 09:18:23,870 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 9 |
+
2024-12-23 09:18:24,131 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 10 |
+
2024-12-23 09:18:24,757 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
|
| 11 |
+
2024-12-23 09:18:57,165 - __main__ - INFO - Starting transcription for file: C:\Users\Dell\AppData\Local\Temp\gradio\0be043d0cfc38d4f1eb1ebde195d35697abf5f4943bde4110e1aeb0bbac318cd\audio.wav
|
| 12 |
+
2024-12-23 09:19:05,373 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/upload "HTTP/1.1 200 OK"
|
| 13 |
+
2024-12-23 09:19:05,815 - httpx - INFO - HTTP Request: POST https://api.assemblyai.com/v2/transcript "HTTP/1.1 200 OK"
|
| 14 |
+
2024-12-23 09:19:06,223 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/ce51a22f-27ce-4192-85e3-1196af36edf3 "HTTP/1.1 200 OK"
|
| 15 |
+
2024-12-23 09:19:09,647 - httpx - INFO - HTTP Request: GET https://api.assemblyai.com/v2/transcript/ce51a22f-27ce-4192-85e3-1196af36edf3 "HTTP/1.1 200 OK"
|
| 16 |
+
2024-12-23 09:19:09,653 - __main__ - INFO - Transcription completed successfully
|
| 17 |
+
2024-12-23 09:19:26,359 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 18 |
+
2024-12-23 09:19:26,489 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmplfba0o99\6b06c5d6-60c2-4676-9ce0-b4e25783f896.mp3
|
| 19 |
+
2024-12-23 09:19:27,958 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 20 |
+
2024-12-23 09:19:28,017 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmplfba0o99\bc7db868-d31d-49c3-8b33-02bc31c9280a.mp3
|
| 21 |
+
2024-12-23 09:19:29,613 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 22 |
+
2024-12-23 09:19:29,617 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmplfba0o99\331d2eb2-dafd-4907-836e-e7f07c4b6ab0.mp3
|
| 23 |
+
2024-12-23 09:19:31,162 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 24 |
+
2024-12-23 09:19:31,166 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmplfba0o99\76a1fffd-ffdb-4255-a94b-c160ed77cc82.mp3
|
| 25 |
+
2024-12-23 09:19:32,902 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 26 |
+
2024-12-23 09:19:32,986 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmplfba0o99\51cdefe8-2c5d-40db-aeba-d3828733dd9c.mp3
|
| 27 |
+
2024-12-23 09:19:34,520 - httpx - INFO - HTTP Request: POST https://api.elevenlabs.io/v1/text-to-speech/X8p6aGE1votZZk0BMvbQ?optimize_streaming_latency=0&output_format=mp3_22050_32 "HTTP/1.1 200 OK"
|
| 28 |
+
2024-12-23 09:19:34,570 - __main__ - INFO - Audio file saved successfully: C:\Users\Dell\AppData\Local\Temp\tmplfba0o99\7d42ae25-99f4-4b45-a794-4848ba8d34e3.mp3
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio==4.44.1
|
| 2 |
+
pydantic==2.8.2
|
| 3 |
+
elevenlabs==1.4.1
|
| 4 |
+
translate== 3.6.1
|
| 5 |
+
assemblyai==0.30.0
|
| 6 |
+
python-dotenv==1.0.1
|
src/__pycache__/appconfig.cpython-312.pyc
ADDED
|
Binary file (410 Bytes). View file
|
|
|
src/find_voice.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
import sys
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
# Add the parent directory to the system path to import your API key from the appconfig file
|
| 7 |
+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
| 8 |
+
|
| 9 |
+
from config.appconfig import ELEVENLABS_API_KEY, VOICE_ID
|
| 10 |
+
|
| 11 |
+
# Define the API endpoint for fetching voices
|
| 12 |
+
url = "https://api.elevenlabs.io/v1/voices"
|
| 13 |
+
|
| 14 |
+
# Set up the headers with the API key for authentication
|
| 15 |
+
headers = {
|
| 16 |
+
"Accept": "application/json",
|
| 17 |
+
"xi-api-key": ELEVENLABS_API_KEY,
|
| 18 |
+
"Content-Type": "application/json"
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
# Send a GET request to fetch the voices
|
| 22 |
+
response = requests.get(url, headers=headers)
|
| 23 |
+
|
| 24 |
+
# Parse the JSON response
|
| 25 |
+
if response.status_code == 200:
|
| 26 |
+
data = response.json()
|
| 27 |
+
|
| 28 |
+
# Check if 'voices' key is present in the response
|
| 29 |
+
if 'voices' in data:
|
| 30 |
+
# Iterate through the voices and print their details
|
| 31 |
+
print("Available voices:")
|
| 32 |
+
found_voice = False
|
| 33 |
+
for voice in data['voices']:
|
| 34 |
+
print(f"{voice['name']}; {voice['voice_id']}")
|
| 35 |
+
# Check for the specific voice name or ID
|
| 36 |
+
if voice['name'] == "Exhibit 1" or voice['voice_id'] == VOICE_ID:
|
| 37 |
+
found_voice = True
|
| 38 |
+
|
| 39 |
+
# If the voice is not found, notify the user
|
| 40 |
+
if not found_voice:
|
| 41 |
+
print(f"\nThe voice 'Exhibit 1' with ID {VOICE_ID} was not found. Ensure it is active on the account.")
|
| 42 |
+
else:
|
| 43 |
+
print("Error: 'voices' key not found in the API response.")
|
| 44 |
+
print("Full response:", json.dumps(data, indent=2))
|
| 45 |
+
else:
|
| 46 |
+
# Print an error message if the request fails
|
| 47 |
+
print(f"Failed to fetch voices. HTTP Status Code: {response.status_code}")
|
| 48 |
+
print("Response:", response.text)
|
src/voice_translator.py
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
import logging
|
| 4 |
+
import tempfile
|
| 5 |
+
import shutil
|
| 6 |
+
import gradio as gr
|
| 7 |
+
import assemblyai as aai
|
| 8 |
+
from translate import Translator
|
| 9 |
+
import uuid
|
| 10 |
+
from elevenlabs import VoiceSettings
|
| 11 |
+
from elevenlabs.client import ElevenLabs
|
| 12 |
+
from pathlib import Path
|
| 13 |
+
import warnings
|
| 14 |
+
warnings.filterwarnings("ignore")
|
| 15 |
+
|
| 16 |
+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
| 17 |
+
|
| 18 |
+
# Configure logging
|
| 19 |
+
logging.basicConfig(
|
| 20 |
+
level=logging.INFO,
|
| 21 |
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
| 22 |
+
handlers=[
|
| 23 |
+
logging.FileHandler('logs/voice_translator.log'),
|
| 24 |
+
logging.StreamHandler()
|
| 25 |
+
]
|
| 26 |
+
)
|
| 27 |
+
logger = logging.getLogger(__name__)
|
| 28 |
+
|
| 29 |
+
class VoiceTranslator:
|
| 30 |
+
|
| 31 |
+
LANGUAGES = [
|
| 32 |
+
'ar', 'zh', 'nl', 'en', 'fr', 'de', 'hi', 'it', 'ja', 'ko', 'pt', 'ru', 'es', 'sv', 'tr', 'uk'
|
| 33 |
+
]
|
| 34 |
+
|
| 35 |
+
def __init__(self, assemblyai_key: str, elevenlabs_key: str, voice_id: str):
|
| 36 |
+
"""Initialize the voice translator with API keys."""
|
| 37 |
+
self.assemblyai_key = assemblyai_key
|
| 38 |
+
self.elevenlabs_key = elevenlabs_key
|
| 39 |
+
self.voice_id = voice_id
|
| 40 |
+
self.temp_dir = Path(tempfile.mkdtemp())
|
| 41 |
+
aai.settings.api_key = self.assemblyai_key
|
| 42 |
+
self.elevenlabs_client = ElevenLabs(api_key=self.elevenlabs_key)
|
| 43 |
+
|
| 44 |
+
# Validate API keys
|
| 45 |
+
self.validate_api_keys()
|
| 46 |
+
logger.info("VoiceTranslator initialized successfully")
|
| 47 |
+
|
| 48 |
+
def __del__(self):
|
| 49 |
+
"""Cleanup temporary files on deletion."""
|
| 50 |
+
try:
|
| 51 |
+
shutil.rmtree(self.temp_dir)
|
| 52 |
+
logger.info("Temporary directory cleaned up successfully")
|
| 53 |
+
except Exception as e:
|
| 54 |
+
logger.error(f"Error cleaning up temporary directory: {e}")
|
| 55 |
+
|
| 56 |
+
def validate_api_keys(self):
|
| 57 |
+
"""Validate that all required API keys are present."""
|
| 58 |
+
if not self.assemblyai_key:
|
| 59 |
+
raise ValueError("Missing AssemblyAI API Key")
|
| 60 |
+
if not self.elevenlabs_key:
|
| 61 |
+
raise ValueError("Missing ElevenLabs API Key")
|
| 62 |
+
if not self.voice_id:
|
| 63 |
+
raise ValueError("Missing Voice ID")
|
| 64 |
+
|
| 65 |
+
def voice_to_voice(self, audio_file):
|
| 66 |
+
"""Convert voice input to multiple translated voice outputs."""
|
| 67 |
+
# Transcript speech
|
| 68 |
+
transcript = self.transcribe_audio(audio_file)
|
| 69 |
+
|
| 70 |
+
# Translate text
|
| 71 |
+
list_translations = self.translate_text(transcript)
|
| 72 |
+
generated_audio_paths = []
|
| 73 |
+
|
| 74 |
+
# Generate speech from text
|
| 75 |
+
for translation in list_translations:
|
| 76 |
+
translated_audio_file_name = self.text_to_speech(translation)
|
| 77 |
+
path = Path(translated_audio_file_name)
|
| 78 |
+
generated_audio_paths.append(path)
|
| 79 |
+
|
| 80 |
+
return (
|
| 81 |
+
generated_audio_paths[0], generated_audio_paths[1], generated_audio_paths[2],
|
| 82 |
+
generated_audio_paths[3], generated_audio_paths[4], generated_audio_paths[5],
|
| 83 |
+
list_translations[0], list_translations[1], list_translations[2],
|
| 84 |
+
list_translations[3], list_translations[4], list_translations[5]
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
def transcribe_audio(self, audio_file):
|
| 88 |
+
"""Transcribe audio file to text."""
|
| 89 |
+
try:
|
| 90 |
+
logger.info(f"Starting transcription for file: {audio_file}")
|
| 91 |
+
transcriber = aai.Transcriber()
|
| 92 |
+
|
| 93 |
+
if not os.path.exists(audio_file):
|
| 94 |
+
raise FileNotFoundError(f"Audio file not found: {audio_file}")
|
| 95 |
+
|
| 96 |
+
transcript = transcriber.transcribe(audio_file)
|
| 97 |
+
if transcript.status == aai.TranscriptStatus.error:
|
| 98 |
+
logger.error(f"Transcription error: {transcript.error}")
|
| 99 |
+
raise gr.Error(f"Transcription failed: {transcript.error}")
|
| 100 |
+
|
| 101 |
+
logger.info("Transcription completed successfully")
|
| 102 |
+
return transcript.text
|
| 103 |
+
|
| 104 |
+
except Exception as e:
|
| 105 |
+
logger.error(f"Transcription error: {str(e)}")
|
| 106 |
+
raise gr.Error(f"Transcription failed: {str(e)}")
|
| 107 |
+
|
| 108 |
+
def translate_text(self, text: str) -> list:
|
| 109 |
+
"""Translate text to multiple languages."""
|
| 110 |
+
list_translations = []
|
| 111 |
+
target_languages = ['ar', 'zh', 'ru', 'fr', 'ja', 'ko']
|
| 112 |
+
|
| 113 |
+
for lan in target_languages:
|
| 114 |
+
translator = Translator(from_lang="en", to_lang=lan)
|
| 115 |
+
translation = translator.translate(text)
|
| 116 |
+
list_translations.append(translation)
|
| 117 |
+
|
| 118 |
+
return list_translations
|
| 119 |
+
|
| 120 |
+
def text_to_speech(self, text: str) -> str:
|
| 121 |
+
"""Convert text to speech using ElevenLabs API."""
|
| 122 |
+
response = self.elevenlabs_client.text_to_speech.convert(
|
| 123 |
+
voice_id=self.voice_id,
|
| 124 |
+
optimize_streaming_latency="0",
|
| 125 |
+
output_format="mp3_22050_32",
|
| 126 |
+
text=text,
|
| 127 |
+
model_id="eleven_multilingual_v2",
|
| 128 |
+
voice_settings=VoiceSettings(
|
| 129 |
+
stability=0.5,
|
| 130 |
+
similarity_boost=0.8,
|
| 131 |
+
style=0.5,
|
| 132 |
+
use_speaker_boost=True,
|
| 133 |
+
),
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
save_file_path = str(self.temp_dir / f"{uuid.uuid4()}.mp3")
|
| 137 |
+
|
| 138 |
+
# Writing the audio to a file
|
| 139 |
+
with open(save_file_path, "wb") as f:
|
| 140 |
+
for chunk in response:
|
| 141 |
+
if chunk:
|
| 142 |
+
f.write(chunk)
|
| 143 |
+
|
| 144 |
+
logger.info(f"Audio file saved successfully: {save_file_path}")
|
| 145 |
+
return save_file_path
|
| 146 |
+
|
| 147 |
+
def create_demo():
|
| 148 |
+
translator = VoiceTranslator(
|
| 149 |
+
assemblyai_key=os.getenv("ASSEMBLYAI_API_KEY"),
|
| 150 |
+
elevenlabs_key=os.getenv("ELEVENLABS_API_KEY"),
|
| 151 |
+
voice_id=os.getenv("VOICE_ID")
|
| 152 |
+
)
|
| 153 |
+
|
| 154 |
+
with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="indigo")) as demo:
|
| 155 |
+
gr.Markdown(
|
| 156 |
+
"""
|
| 157 |
+
# 🌍 AI-Powered Multilingual Voice Translator
|
| 158 |
+
### Transform your voice into multiple languages instantly
|
| 159 |
+
|
| 160 |
+
Record your message in English, and receive translations in multiple languages.
|
| 161 |
+
"""
|
| 162 |
+
)
|
| 163 |
+
with gr.Row():
|
| 164 |
+
with gr.Column():
|
| 165 |
+
audio_input = gr.Audio(
|
| 166 |
+
sources=["microphone"],
|
| 167 |
+
type="filepath",
|
| 168 |
+
label="🎤 Record Audio (English)",
|
| 169 |
+
show_download_button=True,
|
| 170 |
+
waveform_options=gr.WaveformOptions(
|
| 171 |
+
waveform_color="#01C6FF",
|
| 172 |
+
waveform_progress_color="#0066B4",
|
| 173 |
+
skip_length=2,
|
| 174 |
+
show_controls=False,
|
| 175 |
+
),
|
| 176 |
+
)
|
| 177 |
+
with gr.Row():
|
| 178 |
+
submit = gr.Button("Translate", variant="primary")
|
| 179 |
+
status = gr.Textbox(label="Status", interactive=False)
|
| 180 |
+
clear_btn = gr.ClearButton([audio_input, status], value="Clear")
|
| 181 |
+
|
| 182 |
+
with gr.Row():
|
| 183 |
+
with gr.Group():
|
| 184 |
+
ar_output = gr.Audio(label="Arabic", interactive=False)
|
| 185 |
+
ar_text = gr.Markdown()
|
| 186 |
+
|
| 187 |
+
with gr.Group():
|
| 188 |
+
zh_output = gr.Audio(label="Chinese", interactive=False)
|
| 189 |
+
zh_text = gr.Markdown()
|
| 190 |
+
|
| 191 |
+
with gr.Group():
|
| 192 |
+
ru_output = gr.Audio(label="Russian", interactive=False)
|
| 193 |
+
ru_text = gr.Markdown()
|
| 194 |
+
|
| 195 |
+
with gr.Row():
|
| 196 |
+
with gr.Group():
|
| 197 |
+
fr_output = gr.Audio(label="French", interactive=False)
|
| 198 |
+
fr_text = gr.Markdown()
|
| 199 |
+
|
| 200 |
+
with gr.Group():
|
| 201 |
+
jp_output = gr.Audio(label="Japanese", interactive=False)
|
| 202 |
+
jp_text = gr.Markdown()
|
| 203 |
+
|
| 204 |
+
with gr.Group():
|
| 205 |
+
ko_output = gr.Audio(label="Korean", interactive=False)
|
| 206 |
+
ko_text = gr.Markdown()
|
| 207 |
+
|
| 208 |
+
output_components = [
|
| 209 |
+
ar_output, zh_output, ru_output, fr_output, jp_output, ko_output,
|
| 210 |
+
ar_text, zh_text, ru_text, fr_text, jp_text, ko_text
|
| 211 |
+
]
|
| 212 |
+
|
| 213 |
+
submit.click(
|
| 214 |
+
fn=translator.voice_to_voice,
|
| 215 |
+
inputs=audio_input,
|
| 216 |
+
outputs=output_components,
|
| 217 |
+
show_progress=True
|
| 218 |
+
)
|
| 219 |
+
|
| 220 |
+
return demo
|
| 221 |
+
|
| 222 |
+
if __name__ == "__main__":
|
| 223 |
+
demo = create_demo()
|
| 224 |
+
demo.launch(share=True)
|
src/voice_translator_copy.py
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
import logging
|
| 4 |
+
import gradio as gr
|
| 5 |
+
import assemblyai as aai
|
| 6 |
+
from translate import Translator
|
| 7 |
+
import uuid
|
| 8 |
+
from elevenlabs import VoiceSettings
|
| 9 |
+
from elevenlabs.client import ElevenLabs
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
import tempfile
|
| 12 |
+
import shutil
|
| 13 |
+
from pydantic import ConfigDict
|
| 14 |
+
from typing import List, Tuple, Optional, Union
|
| 15 |
+
|
| 16 |
+
gr.__dict__.update(ConfigDict(arbitrary_types_allowed=True))
|
| 17 |
+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
| 18 |
+
|
| 19 |
+
# Import configuration keys
|
| 20 |
+
from config.appconfig import ASSEMBLYAI_API_KEY, ELEVENLABS_API_KEY, VOICE_ID
|
| 21 |
+
|
| 22 |
+
# Configure logging
|
| 23 |
+
logging.basicConfig(
|
| 24 |
+
level=logging.INFO,
|
| 25 |
+
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
| 26 |
+
handlers=[
|
| 27 |
+
logging.FileHandler(r'logs/voice_translator.log'),
|
| 28 |
+
logging.StreamHandler()
|
| 29 |
+
]
|
| 30 |
+
)
|
| 31 |
+
logger = logging.getLogger(__name__)
|
| 32 |
+
|
| 33 |
+
class VoiceTranslator:
|
| 34 |
+
LANGUAGES = [
|
| 35 |
+
("ar", "Arabic"),
|
| 36 |
+
("zh", "Chinese"),
|
| 37 |
+
("nl", "Dutch"),
|
| 38 |
+
("en", "English"),
|
| 39 |
+
("fr", "French"),
|
| 40 |
+
("de", "German"),
|
| 41 |
+
("hi", "Hindi"),
|
| 42 |
+
("it", "Italian"),
|
| 43 |
+
("ja", "Japanese"),
|
| 44 |
+
("ko", "Korean"),
|
| 45 |
+
("pt", "Portuguese"),
|
| 46 |
+
("ru", "Russian"),
|
| 47 |
+
("es", "Spanish"),
|
| 48 |
+
("sv", "Swedish"),
|
| 49 |
+
("tr", "Turkish"),
|
| 50 |
+
("uk", "Ukrainian")
|
| 51 |
+
]
|
| 52 |
+
|
| 53 |
+
def __init__(self, assemblyai_key: str, elevenlabs_key: str, voice_id: str):
|
| 54 |
+
"""Initialize the voice translator with API keys."""
|
| 55 |
+
self.assemblyai_key = assemblyai_key
|
| 56 |
+
self.elevenlabs_key = elevenlabs_key
|
| 57 |
+
self.voice_id = voice_id
|
| 58 |
+
self.temp_dir = Path(tempfile.mkdtemp())
|
| 59 |
+
aai.settings.api_key = self.assemblyai_key
|
| 60 |
+
self.elevenlabs_client = ElevenLabs(api_key=self.elevenlabs_key)
|
| 61 |
+
|
| 62 |
+
# Validate API keys
|
| 63 |
+
self.validate_api_keys()
|
| 64 |
+
logger.info("VoiceTranslator initialized successfully")
|
| 65 |
+
|
| 66 |
+
def __del__(self):
|
| 67 |
+
"""Cleanup temporary files on deletion."""
|
| 68 |
+
try:
|
| 69 |
+
shutil.rmtree(self.temp_dir)
|
| 70 |
+
logger.info("Temporary directory cleaned up successfully")
|
| 71 |
+
except Exception as e:
|
| 72 |
+
logger.error(f"Error cleaning up temporary directory: {e}")
|
| 73 |
+
|
| 74 |
+
def validate_api_keys(self):
|
| 75 |
+
if not self.assemblyai_key:
|
| 76 |
+
raise ValueError("Missing AssemblyAI API Key")
|
| 77 |
+
if not self.elevenlabs_key:
|
| 78 |
+
raise ValueError("Missing ElevenLabs API Key")
|
| 79 |
+
if not self.voice_id:
|
| 80 |
+
raise ValueError("Missing Voice ID")
|
| 81 |
+
|
| 82 |
+
def handle_audio_input(self, audio_data: Union[str, tuple]) -> str:
|
| 83 |
+
"""Handle different types of audio input and return a valid file path."""
|
| 84 |
+
try:
|
| 85 |
+
if isinstance(audio_data, tuple):
|
| 86 |
+
sample_rate, audio_array = audio_data
|
| 87 |
+
temp_path = self.temp_dir / f"input_{uuid.uuid4()}.wav"
|
| 88 |
+
gr.Audio.write_audio(str(temp_path), audio_array, sample_rate)
|
| 89 |
+
return str(temp_path)
|
| 90 |
+
elif isinstance(audio_data, str):
|
| 91 |
+
return audio_data
|
| 92 |
+
else:
|
| 93 |
+
raise ValueError(f"Unsupported audio input type: {type(audio_data)}")
|
| 94 |
+
except Exception as e:
|
| 95 |
+
logger.error(f"Error handling audio input: {e}")
|
| 96 |
+
raise gr.Error(f"Failed to process audio input: {str(e)}")
|
| 97 |
+
|
| 98 |
+
def transcribe_audio(self, audio_file: str) -> Optional[str]:
|
| 99 |
+
"""Transcribe audio file to text."""
|
| 100 |
+
try:
|
| 101 |
+
logger.info(f"Starting transcription for file: {audio_file}")
|
| 102 |
+
transcriber = aai.Transcriber()
|
| 103 |
+
|
| 104 |
+
if not os.path.exists(audio_file):
|
| 105 |
+
raise FileNotFoundError(f"Audio file not found: {audio_file}")
|
| 106 |
+
|
| 107 |
+
transcript = transcriber.transcribe(audio_file)
|
| 108 |
+
if transcript.status == aai.TranscriptStatus.error:
|
| 109 |
+
logger.error(f"Transcription error: {transcript.error}")
|
| 110 |
+
raise gr.Error(f"Transcription failed: {transcript.error}")
|
| 111 |
+
|
| 112 |
+
logger.info("Transcription completed successfully")
|
| 113 |
+
return transcript.text
|
| 114 |
+
|
| 115 |
+
except Exception as e:
|
| 116 |
+
logger.error(f"Transcription error: {str(e)}")
|
| 117 |
+
raise gr.Error(f"Transcription failed: {str(e)}")
|
| 118 |
+
|
| 119 |
+
def translate_text(self, text: str, selected_languages: List[Tuple[str, str]]) -> List[Tuple[str, str]]:
|
| 120 |
+
"""Translate text to selected languages."""
|
| 121 |
+
try:
|
| 122 |
+
logger.info("Starting text translation")
|
| 123 |
+
translations = []
|
| 124 |
+
for lang_code, lang_name in selected_languages:
|
| 125 |
+
try:
|
| 126 |
+
translator = Translator(from_lang="en", to_lang=lang_code)
|
| 127 |
+
translation = translator.translate(text)
|
| 128 |
+
translations.append((translation, lang_name))
|
| 129 |
+
logger.info(f"Translation to {lang_name} completed")
|
| 130 |
+
except Exception as e:
|
| 131 |
+
logger.error(f"Error translating to {lang_name}: {e}")
|
| 132 |
+
translations.append((text, lang_name)) # Fallback to original text
|
| 133 |
+
|
| 134 |
+
return translations
|
| 135 |
+
|
| 136 |
+
except Exception as e:
|
| 137 |
+
logger.error(f"Translation error: {str(e)}")
|
| 138 |
+
raise gr.Error(f"Translation failed: {str(e)}")
|
| 139 |
+
|
| 140 |
+
def text_to_speech(self, text: str) -> str:
|
| 141 |
+
"""Convert text to speech using ElevenLabs."""
|
| 142 |
+
try:
|
| 143 |
+
logger.info("Starting text-to-speech conversion")
|
| 144 |
+
output_path = self.temp_dir / f"{uuid.uuid4()}.mp3"
|
| 145 |
+
|
| 146 |
+
response = self.elevenlabs_client.text_to_speech.convert(
|
| 147 |
+
voice_id=self.voice_id,
|
| 148 |
+
optimize_streaming_latency="0",
|
| 149 |
+
output_format="mp3_22050_32",
|
| 150 |
+
text=text[:500], # Rate limit workaround
|
| 151 |
+
model_id="eleven_multilingual_v2",
|
| 152 |
+
voice_settings=VoiceSettings(
|
| 153 |
+
stability=0.5,
|
| 154 |
+
similarity_boost=0.8,
|
| 155 |
+
style=0.5,
|
| 156 |
+
use_speaker_boost=True,
|
| 157 |
+
),
|
| 158 |
+
)
|
| 159 |
+
|
| 160 |
+
# Write the audio file in chunks
|
| 161 |
+
with open(output_path, "wb") as f:
|
| 162 |
+
for chunk in response:
|
| 163 |
+
if chunk:
|
| 164 |
+
f.write(chunk)
|
| 165 |
+
|
| 166 |
+
logger.info(f"Audio file saved successfully: {output_path}")
|
| 167 |
+
return str(output_path)
|
| 168 |
+
|
| 169 |
+
except Exception as e:
|
| 170 |
+
logger.error(f"Text-to-speech error: {str(e)}")
|
| 171 |
+
raise gr.Error(f"Text-to-speech conversion failed: {str(e)}")
|
| 172 |
+
|
| 173 |
+
def process_voice(self, audio_input: Union[str, tuple], selected_languages: List[str]) -> List[Union[str, None]]:
|
| 174 |
+
"""Process voice input and return translated audio files and texts."""
|
| 175 |
+
try:
|
| 176 |
+
# Handle audio input and get valid file path
|
| 177 |
+
audio_file = self.handle_audio_input(audio_input)
|
| 178 |
+
|
| 179 |
+
# Convert selected language names to (code, name) tuples
|
| 180 |
+
selected_langs = [(code, name) for code, name in self.LANGUAGES if name in selected_languages]
|
| 181 |
+
|
| 182 |
+
# Transcribe audio
|
| 183 |
+
transcript = self.transcribe_audio(audio_file)
|
| 184 |
+
if not transcript:
|
| 185 |
+
raise gr.Error("Transcription failed")
|
| 186 |
+
|
| 187 |
+
# Translate text
|
| 188 |
+
translations = self.translate_text(transcript, selected_langs)
|
| 189 |
+
|
| 190 |
+
# Generate audio for each translation
|
| 191 |
+
outputs = []
|
| 192 |
+
for translation, _ in translations:
|
| 193 |
+
try:
|
| 194 |
+
audio_path = self.text_to_speech(translation)
|
| 195 |
+
outputs.extend([audio_path, translation])
|
| 196 |
+
except Exception as e:
|
| 197 |
+
logger.error(f"Error processing translation: {e}")
|
| 198 |
+
outputs.extend([None, translation])
|
| 199 |
+
|
| 200 |
+
return outputs
|
| 201 |
+
|
| 202 |
+
except Exception as e:
|
| 203 |
+
logger.error(f"Voice processing error: {str(e)}")
|
| 204 |
+
raise gr.Error(f"Voice processing failed: {str(e)}")
|
| 205 |
+
|
| 206 |
+
def create_gradio_interface(translator: VoiceTranslator):
|
| 207 |
+
"""Create and configure the Gradio interface."""
|
| 208 |
+
with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="indigo")) as demo:
|
| 209 |
+
gr.Markdown(
|
| 210 |
+
"""
|
| 211 |
+
# 🌍 AI-Powered Multilingual Voice Translator
|
| 212 |
+
### Transform your voice into multiple languages instantly
|
| 213 |
+
|
| 214 |
+
Record your message in English, select at least 4 target languages, and receive translations.
|
| 215 |
+
"""
|
| 216 |
+
)
|
| 217 |
+
|
| 218 |
+
with gr.Row():
|
| 219 |
+
with gr.Column():
|
| 220 |
+
audio_input = gr.Audio(
|
| 221 |
+
sources=["microphone"],
|
| 222 |
+
type="filepath",
|
| 223 |
+
label="🎤 Record or Upload Audio (English)"
|
| 224 |
+
)
|
| 225 |
+
lang_selection = gr.CheckboxGroup(
|
| 226 |
+
choices=[lang_name for _, lang_name in VoiceTranslator.LANGUAGES],
|
| 227 |
+
label="Select at least 4 Target Languages",
|
| 228 |
+
interactive=True
|
| 229 |
+
)
|
| 230 |
+
with gr.Row():
|
| 231 |
+
submit_btn = gr.Button("Translate", variant="primary")
|
| 232 |
+
status = gr.Textbox(label="Status", interactive=False)
|
| 233 |
+
|
| 234 |
+
# Create fixed output components
|
| 235 |
+
output_boxes = []
|
| 236 |
+
with gr.Row() as output_row:
|
| 237 |
+
for _, lang_name in VoiceTranslator.LANGUAGES:
|
| 238 |
+
with gr.Column(visible=False) as lang_column:
|
| 239 |
+
audio_out = gr.Audio(
|
| 240 |
+
label=f"{lang_name} Audio",
|
| 241 |
+
interactive=False,
|
| 242 |
+
type="filepath" # Ensure audio files are handled as files
|
| 243 |
+
)
|
| 244 |
+
text_out = gr.Textbox(label=f"{lang_name} Text", interactive=False)
|
| 245 |
+
output_boxes.append({
|
| 246 |
+
"column": lang_column,
|
| 247 |
+
"audio": audio_out,
|
| 248 |
+
"text": text_out,
|
| 249 |
+
"lang": lang_name
|
| 250 |
+
})
|
| 251 |
+
|
| 252 |
+
def update_visible_outputs(selected_langs):
|
| 253 |
+
"""Update visibility of output components based on selected languages."""
|
| 254 |
+
if len(selected_langs) < 4:
|
| 255 |
+
raise gr.Error("Please select at least 4 languages")
|
| 256 |
+
|
| 257 |
+
visibility_updates = []
|
| 258 |
+
output_components = []
|
| 259 |
+
|
| 260 |
+
for box in output_boxes:
|
| 261 |
+
is_visible = box["lang"] in selected_langs
|
| 262 |
+
visibility_updates.append(is_visible)
|
| 263 |
+
|
| 264 |
+
if is_visible:
|
| 265 |
+
output_components.extend([box["audio"], box["text"]])
|
| 266 |
+
|
| 267 |
+
return visibility_updates + output_components
|
| 268 |
+
|
| 269 |
+
def process_inputs(audio, selected_langs):
|
| 270 |
+
"""Process audio input and return translations."""
|
| 271 |
+
try:
|
| 272 |
+
if not audio:
|
| 273 |
+
raise gr.Error("Please provide an audio input")
|
| 274 |
+
if len(selected_langs) < 4:
|
| 275 |
+
raise gr.Error("Please select at least 4 languages")
|
| 276 |
+
|
| 277 |
+
# Get translations from translator
|
| 278 |
+
outputs = translator.process_voice(audio, selected_langs)
|
| 279 |
+
|
| 280 |
+
# Calculate the total number of outputs needed
|
| 281 |
+
total_languages = len(VoiceTranslator.LANGUAGES) # Total number of possible languages
|
| 282 |
+
|
| 283 |
+
# Create visibility updates for all possible languages
|
| 284 |
+
visibility_updates = [box["lang"] in selected_langs for box in output_boxes]
|
| 285 |
+
|
| 286 |
+
# Fill remaining outputs with None for languages not selected
|
| 287 |
+
needed_outputs = total_languages * 2 # Each language needs 2 outputs (audio and text)
|
| 288 |
+
current_outputs = len(outputs)
|
| 289 |
+
padding = [None] * (needed_outputs - current_outputs)
|
| 290 |
+
|
| 291 |
+
return visibility_updates + ["Translation completed successfully!"] + outputs + padding
|
| 292 |
+
|
| 293 |
+
except Exception as e:
|
| 294 |
+
# Handle errors with correct number of outputs
|
| 295 |
+
error_msg = f"Error during translation: {str(e)}"
|
| 296 |
+
visibility_updates = [box["lang"] in selected_langs for box in output_boxes]
|
| 297 |
+
padding = [None] * (total_languages * 2) # Full padding for all possible outputs
|
| 298 |
+
return visibility_updates + [error_msg] + padding
|
| 299 |
+
|
| 300 |
+
# Update visibility when languages are selected
|
| 301 |
+
lang_selection.change(
|
| 302 |
+
fn=update_visible_outputs,
|
| 303 |
+
inputs=[lang_selection],
|
| 304 |
+
outputs=[box["column"] for box in output_boxes] +
|
| 305 |
+
[box["audio"] for box in output_boxes] +
|
| 306 |
+
[box["text"] for box in output_boxes]
|
| 307 |
+
)
|
| 308 |
+
|
| 309 |
+
# Handle translation submission
|
| 310 |
+
submit_btn.click(
|
| 311 |
+
fn=process_inputs,
|
| 312 |
+
inputs=[audio_input, lang_selection],
|
| 313 |
+
outputs=[box["column"] for box in output_boxes] +
|
| 314 |
+
[status] + # Add status output
|
| 315 |
+
[box["audio"] for box in output_boxes] +
|
| 316 |
+
[box["text"] for box in output_boxes],
|
| 317 |
+
show_progress=True
|
| 318 |
+
)
|
| 319 |
+
|
| 320 |
+
return demo
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
if __name__ == "__main__":
|
| 324 |
+
translator = VoiceTranslator(
|
| 325 |
+
assemblyai_key=ASSEMBLYAI_API_KEY,
|
| 326 |
+
elevenlabs_key=ELEVENLABS_API_KEY,
|
| 327 |
+
voice_id=VOICE_ID
|
| 328 |
+
)
|
| 329 |
+
|
| 330 |
+
interface = create_gradio_interface(translator)
|
| 331 |
+
interface.launch(share=True)
|
| 332 |
+
|