M3U , PLSv2 and ASX Play List Specification

.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.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值