Skip to content

Commit

Permalink
[Windows] Critical Error when generation audio #165
Browse files Browse the repository at this point in the history
  • Loading branch information
souzatharsis committed Nov 8, 2024
1 parent 4a5a06c commit 221754b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions podcastfy/text_to_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _generate_audio_segments(self, text: str, temp_dir: str) -> List[str]:
for speaker_type, content in [("question", question), ("answer", answer)]:
temp_file = os.path.join(
temp_dir, f"{idx}_{speaker_type}.{self.audio_format}"
).replace('\\', '/') # Normalize path separators for cross-platform compatibility
)
voice = provider_config.get("default_voices", {}).get(speaker_type)
model = provider_config.get("model")

Expand Down Expand Up @@ -193,7 +193,9 @@ def get_sort_key(file_path: str) -> Tuple[int, int]:
def _setup_directories(self) -> None:
"""Setup required directories for audio processing."""
self.output_directories = self.tts_config.get("output_directories", {})
self.temp_audio_dir = self.tts_config.get("temp_audio_dir")
temp_dir = self.tts_config.get("temp_audio_dir", "data/audio/tmp/").rstrip("/").split("/")
self.temp_audio_dir = os.path.join(*temp_dir)
os.makedirs(self.temp_audio_dir, exist_ok=True)

# Create directories if they don't exist
for dir_path in [
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "podcastfy"
version = "0.3.3"
version = "0.3.4"
description = "An Open Source alternative to NotebookLM's podcast feature: Transforming Multimodal Content into Captivating Multilingual Audio Conversations with GenAI"
authors = ["Tharsis T. P. Souza"]
license = "Apache-2.0"
Expand Down Expand Up @@ -39,14 +39,14 @@ sphinx-rtd-theme = "^3.0.1"
sphinx-autodoc-typehints = "^2.5.0"
nbsphinx = "^0.9.5"
edge-tts = "^6.1.12"
langchain-community = "^0.3.2"
types-pyyaml = "^6.0.12.20240917"
nest-asyncio = "^1.6.0"
ffmpeg = "^1.4"
pytest = "^8.3.3"
pytest-xdist = "^3.6.1"
google-cloud-texttospeech = "^2.21.0"
litellm = "^1.52.0"
langchain-community = "^0.3.5"


[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit 221754b

Please sign in to comment.