chore(.gitignore): add bark_cache directory to gitignore

feat(video.py): use wav format instead of mp3 for generated audio files
feat(montage.py): use Bark TTS instead of 🐸TTS
feat(speak.py): add support for Bark TTS
fix(speak.py): remove unused 🐸TTS import and variable
fix(main.py): fix asyncio.run() call placement
docs: update requirements.txt with new dependencies
This commit is contained in:
Paillat
2023-06-25 21:59:52 +02:00
parent 5498fb7bac
commit 866f1b4138
6 changed files with 74 additions and 30 deletions

View File

@@ -31,7 +31,7 @@ class Video:
os.makedirs( self.path)
script = None
if os.path.exists(os.path.join( self.path, "script.json")):
if input("Video script already exists. Do you want to overwrite it ? (y/N) : ") == "y":
if input("Video script already exists. Do you want to overwrite it ? (y/N) : ").lower() == "y":
os.remove(os.path.join( self.path, "script.json"))
if not os.path.exists(os.path.join( self.path, "script.json")):
@@ -41,14 +41,17 @@ class Video:
script_prompt = f.read()
f.close()
if script_prompt:
printm("Using custom script prompt")
script = await generate_script(self.idea['title'], self.idea['description'], script_prompt)
else:
printm("Using default script prompt")
script = await generate_script(self.idea['title'], self.idea['description'])
script = json.loads(script)
with open(os.path.join( self.path, "script.json"), "w") as f:
json.dump(json.loads(script), f)
json.dump(script, f)
f.close()
else:
with open(os.path.join( self.path, "script.json"), "r") as f:
with open(os.path.join(self.path, "script.json"), "r") as f:
script = json.load(f)
f.close()
await prepare( self.path)