From a42987d8646ea3d076626cde2fe52a8c697ce7c5 Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 15 Feb 2024 18:03:09 +0100 Subject: [PATCH] Add get_file_path method to GenerationContext class --- src/chore/GenerationContext.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chore/GenerationContext.py b/src/chore/GenerationContext.py index a6f99c5..dbba4b1 100644 --- a/src/chore/GenerationContext.py +++ b/src/chore/GenerationContext.py @@ -25,6 +25,9 @@ class GenerationContext: def setup_dir(self): self.dir = f"output/{time.time()}" os.makedirs(self.dir) + + def get_file_path(self, name: str) -> str: + return os.path.join(self.dir, name) def process(self): # IMPORTANT NOTE: All methods called here are expected to be defined as abstract methods in the base classes, if not there is an issue with the engine implementation. @@ -32,4 +35,4 @@ class GenerationContext: script = self.scriptengine.generate() - timed_script = self.ttsengine.synthesize(script, self.dir) + timed_script = self.ttsengine.synthesize(script, self.get_file_path("tts.wav"))