Different ways provide video and audio inputs to DeepWord
import os
from dword.core import DeepWord
from dword.utils import play_audio
from nbdev import show_doc
import random
acc = DeepWord(API_KEY, SECRET_KEY)
acc.generate_video('local_video.mp4', 'sample_audio.mp3', title = 'local_output')
acc.download_video_actors()
!ls video_actors
And then using them to generate videos.
acc.generate_video('video_actors/Julia.mp4', 'sample_audio.mp3', title = 'actor_output')
Tip: If you have a video that contains the audio you want your speaker to say, just pass the video as audio input to DeepWord and it will automatically extract the audio for you.
acc.generate_video('sample_video.mp4', 'another_video.mp4', title = 'two_vids_output')
acc.generate_video('sample_video.mp4', 'local_audio.mp3', title = 'local_output')
To see the available languages you can run
acc._available_languages[:7]
Each language has some speakers
associated with it. To see the available speakers for a particular language run
acc._available_speakers('english_aus')
Once you have your language and speaker, you can use text2speech as follows
text = 'Creating synthetic videos has never been easier thanks to DeepWord\'s powerful api'
language = 'english_us'
available_speakers = acc._available_speakers(language)
speaker = available_speakers[3]
speaker
acc.text2speech(text, language, speaker)
play_audio('text2speech.mp3')