Spaces:
Running
Running
File size: 1,065 Bytes
c2fa877 5dec512 c2fa877 d984557 655c692 c2fa877 95849c2 c2fa877 95849c2 9281119 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
import os
import logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(name)s (%(filename)s): %(message)s",
)
logger = logging.getLogger("audio-books")
OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]
ELEVENLABS_API_KEY = os.environ["ELEVEN_LABS_API_KEY"]
FILE_SIZE_MAX = 0.5 # in mb
OPENAI_MAX_PARALLEL = 8 # empirically set
ELEVENLABS_MAX_PARALLEL = 15 # current limitation of available subscription
# VOICES_CSV_FP = "data/11labs_available_tts_voices.csv"
VOICES_CSV_FP = "data/11labs_available_tts_voices.reviewed.csv"
MAX_TEXT_LEN = 5000
DESCRIPTION = """\
# AI Audiobooks Generator
Create an audiobook from the input text automatically, using Gen-AI!
All you need to do - is to input the book text or select it from the provided Sample Inputs.
AI will do the rest:
- split text into characters
- assign each character a voice
- preprocess text to better convey emotions during Text-to-Speech
- (optionally) add sound effects to create immersive atmosphere
- generate audiobook using Text-to-Speech model
"""
|