Auto-update: Thu Aug 8 16:30:18 PDT 2024
This commit is contained in:
parent
551295549e
commit
ba87576f83
2 changed files with 9 additions and 8 deletions
sijapi
|
@ -24,12 +24,12 @@ HOST = f"{API.BIND}:{API.PORT}"
|
|||
LOCAL_HOSTS = [ipaddress.ip_address(localhost.strip()) for localhost in os.getenv('LOCAL_HOSTS', '127.0.0.1').split(',')] + ['localhost']
|
||||
SUBNET_BROADCAST = os.getenv("SUBNET_BROADCAST", '10.255.255.255')
|
||||
MAX_CPU_CORES = min(int(os.getenv("MAX_CPU_CORES", int(multiprocessing.cpu_count()/2))), multiprocessing.cpu_count())
|
||||
IMG = Configuration.load('img', 'secrets')
|
||||
News = Configuration.load('news', 'secrets')
|
||||
Archivist = Configuration.load('archivist')
|
||||
IMG = Configuration.load('img', 'secrets', Dir)
|
||||
News = Configuration.load('news', 'secrets', Dir)
|
||||
Archivist = Configuration.load('archivist', 'secrets', Dir)
|
||||
Scrape = Configuration.load('scrape', 'secrets', Dir)
|
||||
Serve = Configuration.load('serve')
|
||||
Tts = Configuration.load('tts')
|
||||
Serve = Configuration.load('serve', 'secrets', Dir)
|
||||
Tts = Configuration.load('tts', 'secrets', Dir)
|
||||
|
||||
# Directories & general paths
|
||||
ROUTER_DIR = BASE_DIR / "routers"
|
||||
|
|
|
@ -26,7 +26,7 @@ import tempfile
|
|||
import random
|
||||
import re
|
||||
import os
|
||||
from sijapi import L, Dir, Tts, DEFAULT_VOICE, TTS_SEGMENTS_DIR, VOICE_DIR, PODCAST_DIR, TTS_OUTPUT_DIR, ELEVENLABS_API_KEY
|
||||
from sijapi import L, API, Dir, Tts, TTS_SEGMENTS_DIR, VOICE_DIR, TTS_OUTPUT_DIR, ELEVENLABS_API_KEY
|
||||
from sijapi.utilities import sanitize_filename
|
||||
|
||||
### INITIALIZATIONS ###
|
||||
|
@ -274,6 +274,7 @@ async def get_voice_file_path(voice: str = None, voice_file: UploadFile = None)
|
|||
debug(f"Looking for voice: {voice}")
|
||||
selected_voice = await select_voice(voice)
|
||||
return selected_voice
|
||||
|
||||
elif voice_file and isinstance(voice_file, UploadFile):
|
||||
VOICE_DIR.mkdir(exist_ok=True)
|
||||
|
||||
|
@ -300,8 +301,8 @@ async def get_voice_file_path(voice: str = None, voice_file: UploadFile = None)
|
|||
return str(new_file)
|
||||
|
||||
else:
|
||||
debug(f"{dt_datetime.now().strftime('%Y%m%d%H%M%S')}: No voice specified or file provided, using default voice: {DEFAULT_VOICE}")
|
||||
selected_voice = await select_voice(DEFAULT_VOICE)
|
||||
debug(f"No voice specified or file provided, using default voice: {Tts.xtts.default}")
|
||||
selected_voice = await select_voice(Tts.xtts.default)
|
||||
return selected_voice
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue