Closed BRTSG-FOSS closed 2 years ago
Add volume control:
gd.wr8(gd.REG_VOL_PB,0xFF) #volume control for output
gd.wr8(gd.REG_GPIOX_DIR,0xFF)
gd.wr8(gd.REG_GPIOX,0xFF) #volume switch for speaker
while 1:
for fn in ["trailer_400p.avi"]:
with open(D + fn, "rb") as f:
mp = MoviePlayer(gd,f)
mp.play()
Add OPT_SOUND in play method:
class MoviePlayer:
""" Helper class to play movie with EVE"""
def __init__(self, eve, file_handler, mf_base=const(0xF0000), mf_size=const(0x8000)):
"""""""
def play(self):
""" Start playback a movie"""
eve = self.eve
eve.cmd_playvideo(eve.OPT_MEDIAFIFO | eve.OPT_FULLSCREEN | eve.OPT_NOTEAR | eve.OPT_SOUND)
change from wr
to write_mem
The video layback example is done in commit f886a91 Please have a look and try
refer to https://github.com/jamesbowman/py-bteve/blob/master/examples/video.py and add a video playback example using MediaPlayer class