Emotion Using
myBuddy
The screen that comes with myBuddy can display a variety of expressions through the python interface
Instructions:
Download and unzip video file and case code into the mybuddy system
Change the case file,Replace
/home/er/pymycobot/emo/face_video_3_2.mp4
with the decompressed video file pathfrom pymycobot import MyBuddyEmoticon import time # [video_path, Playback_duration(s)] video1 = ["/home/er/pymycobot/emo/face_video_3_2.mp4", 10] datas = [video1] me = MyBuddyEmoticon(datas) ...
- Execute mybuddy_emoticon_demo.py
API description
MyBuddyEmoticon(file_path: list = [], window_size: tuple = (), *Fuction loop=False) API for playing emoticons
Parameters
file_path (list):
[[path, time]]
The absolute path of facial expression video and the length of time to play.Time in seconds. window_size (tuple):(Length, width)
Size of the playback window (default is full screen). loop (bool): Loop playback or not (default False. only once by default).
file_path()
- Fuction Get Playfile List
- Return
- video path list
add_file_path(path_time)
- Fuction Add Playback File
- Parameters
path_time(list):
[path, time]
The video address to be added and the running time
del_file_path(index)
- Fuction Delete the element with the specified subscript in the playlist list
Parameters
index(int):: The subscript of the element in the playlist to be deleted
pause()
- Fuction Pause playback
run()
- Fuction Continue playing
start()
- Fuction start playing video
join()
- Fuction Wait for the thread playing the video to finish.