vlc matlab模拟,VLC - File Exchange - MATLAB Central

这篇博客介绍了如何通过MATLAB脚本控制VLC播放器,包括播放、暂停、停止、切换曲目、调整位置等操作。同时,可以设置播放模式如循环、随机,并获取当前文件信息如长度、位置和元数据。此外,还提供了添加、移动、删除播放列表项及清空播放列表的方法。
摘要由CSDN通过智能技术生成

Control VLC from a MATLAB script

VLC actions such as play, pause, stop, next, previous, etc. are defined as class methods. VLC settings such as Loop, Random, Repeat and Fullscreen are exposed to MATLAB and can be accessed with set() and get(). Informations about the current file can be retrieved through the 'Current' property (length, position, metadata, etc).

Methods:

add('file'): add "file" to the playlist

play() or play('file'): resume playback or play "file"

pause(): pause playback

stop(): stop playback

next(): play next track

prev(): play previous track

seek(position): seek to position (in seconds)

move(x,y): move item ID x in the playlist after item ID y

remove(x): remove item ID x from the playlist

clear(): empty the playlist

quit(): quit VLC and delete object

Properties:

Port (read only)

Version (read only)

Status (read only)

Current (read only)

Playlist (read only)

Loop

Repeat

Random

Fullscreen

Rate

Volume

Example:

>> v = VLC()

v =

VLC with properties:

Port: 4212

Version: '2.2.8 Weatherwax'

Status: 'stopped'

Current: []

Playlist: [1x1 struct]

Loop: 'off'

Repeat: 'off'

Random: 'off'

Fullscreen: 'off'

Rate: 1

Volume: 256

>> v.play('/Users/Lea/Desktop/3905.aif')

>> v

v =

VLC with properties:

Port: 4212

Version: '2.2.8 Weatherwax'

Status: 'playing'

Current: [1x1 struct]

Playlist: [1x1 struct]

Loop: 'off'

Repeat: 'off'

Random: 'off'

Fullscreen: 'off'

Rate: 1

Volume: 256

>> v.Current

ans =

ID: 4

Length: 77.0903

Meta: [1x1 struct]

Position: 8.8021

>> v.stop()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值