video(视频) 的使用
详细 API 参考:video API
import video
v = video.open("/sd/badapple.avi")
v.volume(50)
import lcd
lcd.init()
from Maix import GPIO, I2S
i2s = I2S(I2S.DEVICE_0)
i2s.channel_config(i2s.CHANNEL_1, I2S.TRANSMITTER, resolution=I2S.RESOLUTION_16_BIT,
cycles=I2S.SCLK_CYCLES_32, align_mode=I2S.RIGHT_JUSTIFYING_MODE)
fm.register(34, fm.fpioa.I2S0_OUT_D1, force=True)
fm.register(35, fm.fpioa.I2S0_SCLK, force=True)
fm.register(33, fm.fpioa.I2S0_WS, force=True)
while True:
if v.play() == 0:
print("play end")
break
v.__del__()
测试用例中 avi 文件地址:badapple.avi
|