一些播放列表(Playlist)的文件格式。

M3U

M3U 是最常见的格式,M3U8 是它的 UTF-8 版本,但一般写 M3U 就可以被正确识别(而且实际上现在已经不用扩展名区分了)。

基本填写:

  • 文件开头必填:#EXTM3U
  • 列表项目路径必填:C:\Documents and Settings\I\My Music\Sample.mp3
  • 基本信息选填:#EXTINF:-1, Sample artist - Sample title
#EXTM3U
 
#EXTINF:-1, Sample artist - Sample title
C:\Documents and Settings\I\My Music\Sample.mp3
 
#EXTINF:-1,Example Artist - Example title
C:\Documents and Settings\I\My Music\Greatest Hits\Example.ogg

注意事项:

  • 列表项目可以是文件、文件夹,或者另外一个播放列表(可能有兼容性问题),可以使用相对或绝对路径,正反斜杠都被支持。
  • 基本信息包括媒体时长(单位秒)和自定义标题,默认时长可以填 -1
Alternative\Band - Song.mp3
Classical\Other Band - New Song.mp3
Stuff.mp3
D:\More Music\Foo.mp3
..\Other Music\Bar.mp3
http://www.example.com:8000/Listen.mp3
http://www.example.com/~user/Mine.mp3

PLS

PLS 是相对 M3U「更有表现力」的一个格式,基本是基于 ini 文件的语法。

  • 文件开头:[playlist]
  • 列表项目:File2=example2.mp3
  • 标题信息(选填):Title2=Just some local audio that is 2mins long
  • 长度信息(选填):Length2=120
  • 文件结尾:NumberOfEntries=4 & Version=2,项目数量和目前固定为2的版本号

示例:

[playlist]

File1=http://relay5.181.fm:8068
Length1=-1

File2=example2.mp3
Title2=Just some local audio that is 2mins long
Length2=120

File3=F:\Music\whatever.m4a
Title3=absolute path on Windows

File4=%UserProfile%\Music\short.ogg
Title4=example for an Environment variable
Length4=5

NumberOfEntries=4
Version=2

ASX

ASX 是用 XML 语法表示的播放列表,示例:

<asx version="3.0">
  <title>Example.com Live Stream</title>
 
  <entry>
    <title>Short Announcement to Play Before Main Stream</title>
    <ref href="http://example.com/announcement.wma" />
    <param name="aParameterName" value="aParameterValue" />
  </entry>
   
  <entry>
    <title>Example radio</title>
    <ref href="http://example.com:8080" />
    <author>Example.com</author>
    <copyright>Copyright © 2005 Example.com</copyright>
  </entry>
</asx>

总览

摘自 wikipedia:

  • .asx, an XML style playlist containing more information about the items on the playlist.[10]
  • .fpl, is a format used by foobar2000.
  • .kpl, Kalliope PlayList, is a kind of XML playlist storing developed to speed up loading and managing playlists.
  • .m3u/.m3u8, a simple text-based list of the locations of the items, with each item on a new line. This is one of the most popular playlist types.
  • .pla, Samsung format(?), binary, Winamp handles these
  • .aimppl, .plc, file extensions for AIMP.
  • .mpcpl file extension for Media Player Classic playlist format and its derivatives (MPC-HC, MPC-BE etc).
  • .pls, a text playlist similar to .ini (program settings) files. It provides the same functionality as extended M3U playlists by default (title and length).
  • .smil is an XML recommendation of the World Wide Web Consortium that includes playlist features. In addition to audio, it supports video and screen layout and is heavily used in Digital Signage.[11]
  • .vlc is a format used by VLC Media Player and is defined as a renamed M3U or PLS playlist.[12]
  • .wpl, is an XML format used in Microsoft Windows Media Player versions 9–12.[10]
  • .xspf, an XML format designed to enable playlist sharing.[13]
  • .zpl is a format used by Zune Media Player, Zoom Player and Creative Zen Media Players.