Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -179,8 +179,9 @@ def main():
|
|
179 |
|
180 |
voice_options = {'Echo (Male)': 'echo', 'Fable (Male)': 'fable', 'Onyx (Male)': 'onyx', 'Nova (Female)': 'nova', 'Shimmer (Female)': 'shimmer', 'Alloy (Female)': 'alloy'}
|
181 |
voice = st.selectbox('Choose the voice you want', list(voice_options.keys()))
|
|
|
182 |
|
183 |
-
# Assuming 1 minute (60 seconds) is 65 words
|
184 |
words_per_minute = 65
|
185 |
words_per_second = words_per_minute / 60
|
186 |
|
@@ -242,7 +243,8 @@ def main():
|
|
242 |
uploaded_video_file.seek(0)
|
243 |
base64Frame, video_filename, video_duration = video_to_frames(uploaded_video_file, frame_sampling_rate=1)
|
244 |
|
245 |
-
prompt = prompt_template
|
|
|
246 |
text = frames_to_story(base64Frame, prompt, openai_key)
|
247 |
|
248 |
audio_filename = text_to_audio(text, openai_key, voice_options[voice])
|
|
|
179 |
|
180 |
voice_options = {'Echo (Male)': 'echo', 'Fable (Male)': 'fable', 'Onyx (Male)': 'onyx', 'Nova (Female)': 'nova', 'Shimmer (Female)': 'shimmer', 'Alloy (Female)': 'alloy'}
|
181 |
voice = st.selectbox('Choose the voice you want', list(voice_options.keys()))
|
182 |
+
|
183 |
|
184 |
+
# Assuming 1 minute (60 seconds) is equivalent to 65 words
|
185 |
words_per_minute = 65
|
186 |
words_per_second = words_per_minute / 60
|
187 |
|
|
|
243 |
uploaded_video_file.seek(0)
|
244 |
base64Frame, video_filename, video_duration = video_to_frames(uploaded_video_file, frame_sampling_rate=1)
|
245 |
|
246 |
+
# prompt = prompt_template
|
247 |
+
prompt = script_templates[selected_script_type] # Ensure this uses the updated template
|
248 |
text = frames_to_story(base64Frame, prompt, openai_key)
|
249 |
|
250 |
audio_filename = text_to_audio(text, openai_key, voice_options[voice])
|