Skip to content

Commit

Permalink
fix meloTTS
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielchua committed Sep 30, 2024
1 parent b9d657b commit d5e153f
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,6 @@
from prompts import SYSTEM_PROMPT
from utils import generate_script, generate_podcast_audio, parse_url

LANGUAGE_MAPPING = {
"English": "en",
"Chinese": "zh",
"French": "fr",
"German": "de",
"Hindi": "hi",
"Italian": "it",
"Japanese": "ja",
"Korean": "ko",
"Polish": "pl",
"Portuguese": "pt",
"Russian": "ru",
"Spanish": "es",
"Turkish": "tr"
}

MELO_TTS_LANGUAGE_MAPPING = {
"English": "EN",
"Spanish": "ES",
"French": "FR",
"Chinese": "ZJ",
"Japanese": "JP",
"Korean": "KR",
}

class DialogueItem(BaseModel):
"""A single dialogue item."""
Expand Down Expand Up @@ -79,6 +55,33 @@ def generate_podcast(
use_advanced_audio: bool,
) -> Tuple[str, str]:
"""Generate the audio and transcript from the PDFs and/or URL."""

LANGUAGE_MAPPING = {
"English": "en",
"Chinese": "zh",
"French": "fr",
"German": "de",
"Hindi": "hi",
"Italian": "it",
"Japanese": "ja",
"Korean": "ko",
"Polish": "pl",
"Portuguese": "pt",
"Russian": "ru",
"Spanish": "es",
"Turkish": "tr"
}

MELO_TTS_LANGUAGE_MAPPING = {
"English": "EN",
"Spanish": "ES",
"French": "FR",
"Chinese": "ZJ",
"Japanese": "JP",
"Korean": "KR",
}


text = ""

# Check if the selected language is supported by MeloTTS when not using advanced audio
Expand Down

0 comments on commit d5e153f

Please sign in to comment.