请教个mplayer脚本的问题,谢谢

sh/bash/dash/ksh/zsh等Shell脚本
回复
ubuntull
帖子: 37
注册时间: 2010-05-23 21:49

请教个mplayer脚本的问题,谢谢

#1

帖子 ubuntull » 2010-07-01 14:39

###music.sh###
#!/bin/sh
musicPath="/home/yy/音乐" #播放文件目录
cd $musicPath
ls | grep -G "\.[WwMm].[Aa3]$" > music.lst
mplayer -playlist music.lst -loop 0

以上脚本需要添加什么内容才能:
1、可以添加ape文件;
2、无序播放。

谢谢!
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 请教个mplayer脚本的问题,谢谢

#2

帖子 eexpress » 2010-07-01 15:17

grep 支持不区分大小写的。-i
正则支持 {xx|yy}的写法的。
无序,不是这软件能作的吧。
● 鸣学
ubuntull
帖子: 37
注册时间: 2010-05-23 21:49

Re: 请教个mplayer脚本的问题,谢谢

#3

帖子 ubuntull » 2010-07-01 15:28

eexpress 写了:grep 支持不区分大小写的。-i
正则支持 {xx|yy}的写法的。
无序,不是这软件能作的吧。
谢谢指教。
这脚本是网上找的, 不懂。
还请问怎样才能添加ape文件?谢谢!
ubuntull
帖子: 37
注册时间: 2010-05-23 21:49

Re: 请教个mplayer脚本的问题,谢谢

#4

帖子 ubuntull » 2010-07-01 15:31

ls | grep -i "\.[WMA].[AE3]$" > music.lst

恩,改成这样可以添加ape了,谢谢。
eth0
帖子: 7
注册时间: 2010-03-16 20:38

Re: 请教个mplayer脚本的问题,谢谢

#5

帖子 eth0 » 2010-07-01 15:42

干嘛不用 ls | grep -i -E "*.mp3|*.wma|*.ape" 过滤,这样看起来更清楚吧。

mplayer 的 -shuffle 选项就是随机播放,不过不知道支不支持播放列表的随机播放。
ubuntull
帖子: 37
注册时间: 2010-05-23 21:49

Re: 请教个mplayer脚本的问题,谢谢

#6

帖子 ubuntull » 2010-07-01 16:11

可以随机,谢谢!
Havanna
帖子: 813
注册时间: 2008-04-20 12:13
系统: OS X, Gentoo, Win8.1
来自: Shanghai, PRC

Re: 请教个mplayer脚本的问题,谢谢

#7

帖子 Havanna » 2010-07-06 8:32

*.{mp3|wma|ape};
?
随机参数-shuffle
aerofox
帖子: 1453
注册时间: 2008-05-24 8:30

Re: 请教个mplayer脚本的问题,谢谢

#8

帖子 aerofox » 2010-07-06 12:27

代码: 全选

#!/bin/bash
shopt -s extglob nocaseglob
mplayer -shuffle *.@(mp3|wma|ape)
头像
yjcong
帖子: 2470
注册时间: 2006-02-28 3:11

Re: 请教个mplayer脚本的问题,谢谢

#9

帖子 yjcong » 2010-07-11 2:27

俺的经验是用mplayer 随机无限重复播放大量音乐文件占用的内存和cpu都很高。
一梦三年,
松风依旧,
萝月何曾老.


灵幽听微, 谁观玉颜?
灼灼春华, 绿叶含丹.
回复