M3U , PLSv2 and ASX Play List Specification

原创 2016年08月29日 16:34:02

.wpl 格式可以创建动态播放列表,而.asx 和.m3u 格式则不能创建动态播放列表。

M3U (WinAmp) Play List Specification

Winamp playlists are just a text file containing links to the location of the proper file. You can crate or edit a playlist in any text editor. It could be anything to MP3, WMA, or even another playlist. Just because something is in a playlist, doesn't mean Winamp can play it though. Winamp will just skip over unknown file formats. This document will hopefully toy to clarify the differences of the playlist formats available.

Generic M3U file

A list of links to files makes a valid generic playlist. The entry can be relative (i.e. \files\song.mp3) or specific (i.e. c:\media\files\son.mp3). Also, URLs can he inserted to point to a stream or a file on the Internet.

Here are a few sample generic MP3/PLS files:

Alternative\Song.mp3
Classical\New_Song.mp3
crap.mp3
F:\more music\foo_bar.mp3
http://www.site.com:8000/listen.pls
http://www.site.com/~user/mine.mp3
Alternative and Classical are sub-directories of the directory that this playlist is stored in."Song.mp3" and "New_Song.mp3" are in sub-directories that this playlist is stored in."Crap.mp3" is in the same directory that the playlist is stored in. "Foo_Bar.mp3" is in the specified directory, which may or may not be the same directory the playlist is in.http://www.site.com:8000/listen.pls is a Shoutcast stream."Mine.mp3" is a MP3 stored on a web server somewhere.

These path options hold true of the extended playlists described below.




Extended M3U

Let's first look at an extended M3U file then I will describe everything below

#EXTM3U
#EXTINF:233,Everclear - So Much For The Afterglow
Alternative\everclear_SMFTA.mp3
#EXTINF:227,Weird Al - Everything You Know Is Wrong
Comedy\Weird_Al_Everything_You_Know_Is_Wrong.mp3
#EXTINF:187,Weird Al Yankovic - This is the Life
Weird_Al_This_Is_The_Life.mp3
#EXTINF:129,Weird Al: Bad Hair Day - Gump
http://www.site.com/~user/gump.mp3
#EXTINF:-1,My Cool Stream
http://www.site.com:8000/listen.pls
  • #EXTM3U At the VERY top of the Extended M3U file is this header, which signifies this is an extended M3U file. "#EXTM3U" must be all capital letters.
  • #EXTINF:233,Everclear - So Much For The Afterglow
    This is the line that tends to confuse people. Let's break it up into parts
    • #EXTINF:
      This signifies this is an Extended Information field. It ends with a colorn.
    • 233,
      This is the time of the file in seconds followed by a comma. (233 seconds = 3:53). On the last entry there is a negative one, this is usually seen on streams, it tells the program to ignore the time entry.
    • Everclear - So Much For The Afterglow
      Title to display. This is usually the title read from the file name or ID3 tags. This also can be the name of a stream. No characters follow the title.
  • Alternative\everclear_SMFTA.mp3: File location as described above with basic playlists.

WinAmp also understands the PLSv2 play list format. Windows Media Player understands M3U and ASX play list formats.


-------------------------------------------------------------------------------------------------------------------------------------------------------

Extended PLS (PLSv2)

This is a simple text file normally named with the .pls extension and read mainly by WinAmp and a few other programs.

The Code

[playlist]
File1=Alternative\everclear - SMFTA.mp3
Title1=Everclear - So Much For The Afterglow
Length1=233
File2=Comedy\Weird Al - Everything You Know Is Wrong.mp3
Title2=Weird Al - Everything You Know Is Wrong
Length2=227
File3=Weird Al - This Is The Life.mp3
Title3=Weird Al Yankovic - This is the Life
Length3=187
File4=http://www.site.com/~user/gump.mp3
Title4=Weird Al: Bad Hair Day - Gump
Length4=129
File5=http://www.site.com:8000/listen.pls
Title5=My Cool Stream
Length5=-1
NumberOfEntries=5
Version=2
  • [playlist]: Signifies that this is a playlist. This is case sensitive.
  • File#=: Location of the file in any of the formats described above. This is also case sensitive. Also the # sign after "File" signifies what file number it is. The first file in the playlist is "File1", the second is "File2" and so on.
  • Title#=: Title to display. This is usually the title read from the file name or ID3 tags. Like the other fields, this is case sensitive. This also can be the name of a stream. Like "File#" the pound sign (#) is replaced by the entry number that is in the playlist.
  • Length#=": Length in seconds, this is aloe case sensitive. On the last entry there is a negative one, this is usually seen on streams, it tells the program to ignore the time entry. Like "File#" the pound sign (#) is replaced by the entry number that is in the playlist.
  • NumberOfEntries=#: The total number of entries in the playlist. This should match the last number on the "File#", "Title#", and "Length#" fields. Also case sensitive.
  • Version=2: This required entry near the bottom tells the player what format the PLS is in. Older versions of the PLS format did not include this. Like everything else, it is case sensitive.
-------------------------------------------------------------------------------------------------------------------------------------------------------

Windows Media Player Play List (ASX)

This is a simple text file normally named with the .asx extension and read mainly by Window Media Player. It has the look of an HTML file with markup tags. This is in fact an XML database file. If you understand XML, this will be easy enough to read. If not don't worry, the format will be explained

The Code

<ASX VERSION="3.0">
 <Author>John Smith</Author>
 <Title>John's CD Clips</Title>
 <Copyright>John Smith Publishing Inc.</Copyright>
 <Abstract>Cafe-Music CD by John Smith and friends</Abstract>
 <Moreinfo href="http://www.johnsmith.com/" />
 <Entry>
   <Author>John & Jane Smith</Author>
   <Title>Raging Tango</Title>
   <Moreinfo href="http://www.johnsmith.com/tango.htm" />
   <ref href = "http://www.johnsmith.com/media/Raging_Tango.mp3"/>
 </Entry>
</ASX>

Please note that elements are stored between tag pairs <TAG> and </TAG>. There are two exceptionsMoreinfo andref which have no end tag. They have a slash just before the end of the tag block. This is described below.

  • <ASX VERSION="3.0"> and </ASX>
    This must be the outer most element, start on the first line and must be in upper case. The version number identifies the version of the layout format. This number depends on the player you intend on using the play list with. A player that only understands 2.0 play lists will likely ignore a 3.0 playlist. At the end of the file you will find the close tag for this open tag </ASX> which is also in upper case. There can only be one ASX element.
  • <Author> and </Author> The information within this tag identifies the author of the entire play list.John Smith in our example.
  • <Copyright> and </Copyright> This identifies the holder of the copyright for the play list.
  • <Abstract> and </Abstract> Gives a short description about the play list.
  • <Moreinfo href="some URL goes here" /> has not end tag. Instead it ends with /> instead of the > alone. No end tag is needed because the only data is stored in thehref parameter. This is the URL path to more information on this play list.
  • <Entry> and </Entry> This element holds the sub elements that describe individual sound files. There can be many of these elements. Each pair of tags is wrapped around the information for a single song.
    • <Author> and </Author> The information within this tag identifies the author of this one sound file.John & Jane Smith in our example.
    • <Title> and </Title> This identifies title of this sound file.
    • <Moreinfo href="some URL goes here" /> has not end tag. Instead it ends with /> instead of the > alone. No end tag is needed because the only data is stored in thehref parameter. This is the URL path to more information on this one sound file.
    • <ref href="some URL goes here" /> has not end tag. Instead it ends with /> instead of the > alone. No end tag is needed because the only data is stored in thehref parameter. This is the URL path to the actual sound file.

Please take notice of the case of the tags. Although tests have shown that Media Player will accept some tags in upper or lower case, it will not accept an opening tag in one case (say upper) and the matching close tag in another case (say lower or mixed). To ensure your play list works properly it is suggested that you use the case shown in the examples above.


软件分享 AirPlayer

软件名称:AirPlayer       与AirPlay指的是同一款软件。一款超小,绿色免安装的影音播放器。新一代界面与交互技术,尽享水晶般绚丽效果,原生支持APE、MP3、FLAC、OGG、TT...
  • disk5
  • disk5
  • 2012年07月06日 15:40
  • 356

c++中vector向量几种情况的总结(向量指针,指针的向量)

1.标准库vector类型 vector 是同一种类型的对象的集合,每个对象都有一个对应的整数索引值。标准库将负责管理与存储元素相关的内存。我们把 vector 称为容器,是因为它可以包含其他对象。...
  • s9434
  • s9434
  • 2016年04月03日 21:35
  • 22684

android 打开各种文件(setDataAndType)

Java代码  /**  * 打开文件  * @param file  */  private void openFile(File file){            Intent in...
  • wh_19910525
  • wh_19910525
  • 2014年11月04日 11:52
  • 10699

M3U , PLSv2 and ASX Play List Specification

M3U , PLSv2 and ASX Play List Specification
  • zxh1112
  • zxh1112
  • 2016年08月29日 16:21
  • 275

进阶使用播放列表ASX

列表文件好处多多,比如制作简单,关键是小!可以随便找个地儿上传它。还有,他还可以实现很多有趣的效果哦~~~1.网址罗列法方法:直接在记事本添加网址,中间回车,保存为WMP支持的媒体格式。2.进阶使用A...
  • zjdonline
  • zjdonline
  • 2007年07月22日 22:58
  • 777

Content-disposition中Attachment和inline的区别、ContentType设置

Content-disposition中Attachment和inline的区别 Content-dispositionAttachment和inline的区别内嵌显示spring downlo...
  • dabinge1
  • dabinge1
  • 2016年09月19日 17:23
  • 3518

文件下载及web文件的contentType类型大全

  • 2011年10月09日 10:10
  • 10KB
  • 下载

M3U文件制作与视频播放器播放M3U

如何制作m3u文件列表与视频播放器播放m3u格式的音乐文件
  • zxg201207120227
  • zxg201207120227
  • 2017年11月12日 23:01
  • 325

Play Framework常用标签list,set,如何遍历list、map类型数据

最近一段时间的项目都是在Play这个框架上进行开发的,挺强大的,但不足之处也挺多的。今天分享下play中强大的标签,遍历list,map类型的数据的用法。 遍历单纯的list数据,例如:List...
  • zwkb24
  • zwkb24
  • 2013年06月09日 17:20
  • 1786

response.setContentType()的作用及参数

response.setContentType(MIME)的作用是使客户端浏览器,区分不同种类的数据,并根据不同的MIME调用浏览器内不同的程序嵌入模块来处理相应的数据。 例如web浏览器就是通过MI...
  • luman1991
  • luman1991
  • 2016年12月01日 16:38
  • 2825
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:M3U , PLSv2 and ASX Play List Specification
举报原因:
原因补充:

(最多只允许输入30个字)