M3U
| 拡張子 | .M3U or .M3U8 (UTF-8を明示する場合) |
|---|---|
| MIME Type | audio/x-mpegurl |
| タイプコード | M3U |
| 種別 | プレイリスト |
M3U はマルチメディアプレイリストのファイルフォーマット。Windows Media Player, iTunes, Winamp, foobar2000, Totem, JuKなど多くのアプリケーションがサポートしているが、正式な仕様は存在せず対応状況はまちまちである。
目次 |
フォーマット [編集]
M3Uファイルは、一つ、または複数のメディアファイルのパスをプレーンテキスト(テキストファイル)で記述したものである。このファイルを、".m3u"または".m3u8"の拡張子で保存する。 M3UファイルのエンコードはWindows-1252の場合が多いものの、CP932に対応しているものも存在する。エンコードがUTF-8であることを明示するとき、拡張子M3U8を使用する。
それぞれのエントリには以下のような記述をする。
- 絶対パス(例: C:\My Music\Heavysets.mp3
- 相対パス(例: Heavysets.mp3)
- URL
M3Uファイルにはコメントを含むことができ、#以降がコメントとみなされる。.
M3Uフォーマットの一般的な使用方法として、単一のエントリにURLを記述することがあげられる。このファイルのおかげで、ストリーミングへのアクセス、ウェブサイトからのダウンロード、インターネットラジオの視聴が容易になる。
iOSのHTTP Live Streamingフォーマットは"M3U" and "M3U8" ファイルをもとにしている。
Extended M3U [編集]
Extended M3UはEXTM3U、拡張M3Uと呼ばれることもある。
命令 [編集]
Extended M3U (EXTM3U) では、#は拡張命令にも使用される。
- #EXTM3U - ヘッダ。ファイルの先頭になければならない。
- #EXTINF - 拡張情報。曲の長さ(秒単位)、タイトルの順に記述する。慣例としてアーティスト名と曲のタイトルは、
-で区切る。
例 [編集]
This is an example of an extended M3U file on the Windows platform. Sample.mp3 and Example.ogg are the media files. 123 and 321 are the lengths in seconds. A length of -1 may be used when the media file is a streaming file, as there is no actual, predefined length value. The value after the length is the title to be shown, which is generally the same as the location of the file which is on the second line.
Mac OS XやLinuxで使用する場合はUnix pathを用いる。
#EXTM3U #EXTINF:123, Sample artist - Sample title C:\Documents and Settings\I\My Music\Sample.mp3 #EXTINF:321,Example Artist - Example title
C:\Documents and Settings\I\My Music\Greatest Hits\Example.ogg
This example shows how to create an M3U file linking to a specified directory (for example, a flash drive, or CD-ROM). The M3U file should contain only one string: the path to the directory. After starting, the media player will play all contents of the directory:
C:\Music
Here is another example, using relative format. The M3U file is placed in the same directory as the music, and directories must be preserved when moving the playlist to another device if subdirectories are used. This method is more flexible, as it does not rely on the file path staying the same.
上記と同じファイルをファイル名sample.m3uでC:\Documents and Settings\I\My Music\に保存する場合の例を以下に示す。
#EXTM3U #EXTINF:123, Sample artist - Sample title Sample.mp3 #EXTINF:321,Example Artist - Example title Greatest Hits\Example.ogg
この相対パスで記述すれば全ファイルをディレクトリ構造を保ったままコピーすれば他のデバイスでそのまま使える。
次に絶対パス、相対パス表記を混ぜた例を示す。
Alternative\Band - Song.mp3 Classical\Other Band - New Song.mp3 Stuff.mp3 D:\More Music\Foo.mp3 ..\Other Music\Bar.mp3 http://emp.cx:8000/Listen.pls http://www.example.com/~user/Mine.mp3
- 注意
- AlternativeとClassicalはプレイリストを保存したディレクトリの下位ディレクトリ。
- "Song", "New Song"はプレイリストを保存したディレクトリの下位ディレクトリに保存されている。
- "Stuff"はプレイリストを保存したディレクトリに保存されている。
- "Foo"はWindowsの特定のボリュームのディレクトリにある。もしかしたらプレイリストの保存されているディレクトリと同じかもしれない。
- "Bar"はプレイリストが保存されている階層と違うディレクトリ。
..\は一つ上のディレクトリを示すもので、その下位ディレクトリであるBarというディレクトリを指している。 - "Listen"はSHOUTcastのURL。
- "Mine"はWebサーバーに保存されたMP3ファイル。
ほかのM3Uファイルへの参照はあまり良く対応できていない。
AnotherPlayList.M3U
以下の例はMp3tagで作成したアリス・イン・チェインズのEP盤アナザー・サイド・オブ・アリスのM3Uファイルである。
#EXTM3U #EXTINF:419,Alice In Chains - Rotten Apple Alice In Chains_Jar Of Flies_01_Rotten Apple.mp3 #EXTINF:260,Alice In Chains - Nutshell Alice In Chains_Jar Of Flies_02_Nutshell.mp3 #EXTINF:255,Alice In Chains - I Stay Away Alice In Chains_Jar Of Flies_03_I Stay Away.mp3 #EXTINF:256,Alice In Chains - No Excuses Alice In Chains_Jar Of Flies_04_No Excuses.mp3 #EXTINF:157,Alice In Chains - Whale And Wasp Alice In Chains_Jar Of Flies_05_Whale And Wasp.mp3 #EXTINF:263,Alice In Chains - Don't Follow Alice In Chains_Jar Of Flies_06_Don't Follow.mp3 #EXTINF:245,Alice In Chains - Swing On This Alice In Chains_Jar Of Flies_07_Swing On This.mp3
関連項目 [編集]
- mp3tag (M3U, EXTM3U)
- Advanced Stream Redirector (ASX)
- PLS
- XSPF
- B4S - Winamp3 XML based playlist format
- Windows Media Player Playlist (WPL)
外部リンク [編集]
- A survey of playlist formats (Lucas Gonze, November 17, 2003)
- M3U (WinAmp) Play List Specification
- HTTP Live Streaming (M3U extension)