www.xbdev.net
xbdev - software development
Sunday July 21, 2024
Home | Contact | Support | Python Language... Power of the Snake .. ..
     
 

Python Language...

Power of the Snake .. ..

 


Text To Speech Videos


Think of this example as a powerpoint presentation on steroids - fully automated with animated videos in the background.

The code below leverage free online video resources (e.g., pexel), and free libraries for text to speech (pyttsx3).

This script builds a single video - goes through the small texts and their associated video, combines them and builds a single video.

About the example

• Just 2 sentences and 2 videos
• Random videos from Pexel and some gibberish words to show the scripts work
• Proof of concept (could be optmized so it doens't redownload videos/convert each time it's run but only when changes occur)
• Also only uses the default voice (you might have other voices settings to make it more realistic)

Generated video output for the below script.




Text To Speech Videos (Text On Screen)


This version takes things a bit further by adding 'text' to the bottom of each video section (i.e., text being converted to speech is added to the bottom so you can both listen or read the text while the video plays).



Things To Try


Some experiments and things to try to take things a bit further:

• Move the text to the top of the screen instead of the bottom (seen better)
• Change the color of the on screen text
• Try more text and video sections (e.g., example was 2 but you can try 6)
• Optimize the code so the downloaded videos are cached in a folder - not downloaded each time it runs (only when it is missing)
• Add some exta overlapping graphics on top of the video
• Try changing the speed and voice for each of the different clip sections
• Develop a simple UI tools, that can edit/preview/download the video
• Upload your videos onto Youtube (share with others your creations)
• Try modifying the text on screen - so it isn't just at the bottom of the video clip section - but the words change as the text is read out on the video

Advanced
• Setting up python web-server and writing a Javascript/HTML interface to edit/load/save videos (run python in the backend using python server setup - see the links and resources at the end for more information)
• Auto match and search for videos on pexel - then recommend them as the default starting videos


Links & Resources


• Text To Speech (Offline) Using pyttsx3 Library LINK
• Web Programming (e.g., Python Server) LINK




















 
Advert (Support Website)

 
 Visitor:
Copyright (c) 2002-2024 xbdev.net - All rights reserved.
Designated articles, tutorials and software are the property of their respective owners.