Change speaking to receive avatar from frontend.

This commit is contained in:
Cristiano Ferreira
2024-02-09 00:13:07 +00:00
parent d532f7deb4
commit b46f6011d3
2 changed files with 5 additions and 4 deletions

5
app.py
View File

@@ -602,7 +602,8 @@ def save_speaking():
def generate_speaking_video():
try:
data = request.get_json()
sp1_result = create_video(data["question"], random.choice(list(AvatarEnum)))
avatar = data.get("avatar", random.choice(list(AvatarEnum)).value)
sp1_result = create_video(data["question"], avatar)
if sp1_result is not None:
sound_file_path = VIDEO_FILES_PATH + sp1_result
firebase_file_path = FIREBASE_SPEAKING_VIDEO_FILES_PATH + sp1_result
@@ -633,7 +634,7 @@ def generate_interactive_video():
try:
data = request.get_json()
sp3_questions = []
avatar = random.choice(list(AvatarEnum))
avatar = data.get("avatar", random.choice(list(AvatarEnum)).value)
app.logger.info('Creating videos for speaking part 3')
for question in data["questions"]: