android
  #121  
Old 11-16-2008, 03:14 AM
3nd3r 3nd3r is offline
Junior Member
 
Join Date: Nov 2008
Posts: 1
Default ty

that's all i wanted to say . just another reason to love my sansae280
Reply With Quote

Advertisement [Remove Advertisement]

  #122  
Old 11-17-2008, 08:44 PM
MikeWeb92576 MikeWeb92576 is offline
Junior Member
 
Join Date: Nov 2008
Posts: 1
Arrow Right

Hi. New here. I own a Phillips SA4010 MP3 player. It recently stopped recognizing my wpl files and will only show .pla files. I have downloaded the program and will comment on it soon.
Reply With Quote

  #123  
Old 02-21-2009, 08:25 AM
imcat imcat is offline
Junior Member
 
Join Date: Feb 2009
Posts: 1
Default Any chance of releasing the source code?

Hate to revive such an old topic, but… any chance of releasing the source as GNU. This program doesn’t seem to be working on the sansa express, and I wouldn’t mind making some updates.
Reply With Quote

  #124  
Old 02-26-2009, 02:04 PM
excellentcode excellentcode is offline
Junior Member
 
Join Date: Sep 2006
Posts: 4
Default partial source code

Hello. I had moved on to an updated version, called PLAme, which mixes in some GUI tools, etc. that I do not want to release at this time. Alas, the playlists that worked for the Sansa e260 stopped working in the Sansa View. I never had the time or inclination to figure out why, suspecting it was something not easy to solve (based on some stuff I saw on the Sansa forum - IIRC, it might even be that newer Sansa units are locked down to ONLY support MTP mode playlists, and not these simple file based ones so I lost interest). I haven't looked at m3u2pla in over 2 years, and PLAme in about a year.

While I am not releasing the source code, here are two functions that make playlist files. One for *some* Sansa units, and one for an Iriver.

Maybe you can use these for some ideas to write an app, but I'd start with the simplest app I could and test it. You might find that certain Sansa players simply don't support easily created drag-n-drop playlists any longer.
This is C# code, just put in your favorite code editor and straighten out the indents for a clearer view.

Good luck.


/// <summary>
/// Assume a list of songs already in the Sansa (e.g. in "Music\folder\...\file.mp3")
/// </summary>
/// <param name="plaName"></param>
/// <param name="songList"></param>
private void NewPla(string plaName, List<string> songList)
{
System.IO.StreamWriter sw = null;

try
{
///FileTools.Kill(plaName);

try
{
//sw = new System.IO.StreamWriter(plaName,false,System.Text.E ncoding.Unicode); // little endian w/preamble
sw = new System.IO.StreamWriter(plaName, false, new UnicodeEncoding(false, false)); // little endian, no preamble

// The Sansa playlist is simply a UNICODE file with the following two lines for a header,
// followed by one line per song, in the format "HARP, song" (or "SDMCC, song")
// this worked on a "e" series but didn't for the "View".
sw.WriteLine("PLP PLAYLIST");
sw.WriteLine("VERSION 1.20\r\n"); // extra \r\n since working sample had it
sw.Flush();

// each line should be like "Music\Folder\etc\Song.mp3"
// leading \ or X:\ will be removed

foreach (string songPath in songList)
{

if (songPath.StartsWith("\\"))
{
// "\Music\Folder\etc\Song.mp3" -> "Music\Folder\etc\Song.mp3"
sw.WriteLine("HARP, " + songPath.Substring(1));
}
else if (songPath.Substring(1, 2).Equals(":\\"))
{
// "X:\Music\Folder\etc\Song.mp3" -> "Music\Folder\etc\Song.mp3"
if (songPath.StartsWith(_mainDrive))
{
// sansa internal storage
sw.WriteLine("HARP, " + songPath.Substring(3));
}
else
{
// memory card in sansa slot
sw.WriteLine("SDMMC, " + songPath.Substring(3));
}
}
else
{
// "Music\Folder\etc\Song.mp3"
sw.WriteLine("HARP, " + songPath);
}

}
//tsStatus.Text = "Created: " + plaName + " [" + fileViewList1.SelectedNames.Count.ToString() + " songs]";
tsStatus.Text = "Created: " + plaName + " [" + songList.Count.ToString() + " songs]";

}
catch (Exception ex)
{
//Say("Error creating .pla file: " + ex.Message);
tsStatus.Text = "Error creating .pla file: " + ex.Message;
}

}
catch (Exception ex)
{
//Say("Exception: " + ex.Message);
tsStatus.Text = "Exception: " + ex.Message;
}
finally
{
if (null != sw) sw.Close();
}
//Say();

} // NewPla

Here is a method for Iriver playlists:
/// <summary>
/// Iriver .PLA based on http://personal.inet.fi/koti/phintsan/iriver-t50.html
/// </summary>
/// <param name="plaName"></param>
/// <param name="songList"></param>
private void NewIriverPla(string plaName, List<string> songList)
{
System.IO.StreamWriter sw = null;
System.IO.BinaryWriter bw = null;

try
{
try
{

//The playlist format is very simple. A conforming playlist file consists of 1+N null-padded 512-byte frames, where N is the number of songs in the playlist. First frame is a header starting with a 32-bit big-endian unsigned integer specifying the number of songs in the playlist. Immediately after this there is an ASCII string "iriver UMS PLA", and that's all for the header frame. Example:

//00000000 00 00 00 0b 69 72 69 76 65 72 20 55 4d 53 20 50 |....iriver UMS P|
//00000010 4c 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |LA..............|
//00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|



bw = new System.IO.BinaryWriter(new FileStream(plaName, FileMode.CreateNew));

byte[] count = BitConverter.GetBytes(songList.Count);
byte[] header = Encoding.ASCII.GetBytes("iriver UMS PLA");
byte[] hpad = new byte[512 - (count.Length + header.Length)];

bw.Write(count[3]);
bw.Write(count[2]);
bw.Write(count[1]);
bw.Write(count[0]);
bw.Write(header);
bw.Write(hpad);

//Each song frame begins with a 16-bit big-endian unsigned integer specifying the index of the first non-directory character of the song's full filename. This index is one-based. The index is there probably just to help the player to strip the directory part out of the song's filename, if there is no title tag in the song file.

//Immediately after the index comes the song's null-terminated full filename. As the filesystem type is VFAT, it is encoded as big-endian UTF-16 without a byte order mark. I have not tried whether the player recognizes wider than two-byte characters. Also, I have used only absolute paths, I don't know if relative paths would work.

//The index and filename are everything there is in a single song frame. Note that the filename must fit into one 512-byte frame. So the filename, including the directory part, can have at most 255 (two-byte) characters. The player-accompanied iriver plus program seems to mess up your data without warning if you happen to use more than 255 characters, so don't do that.

//Example:

//00000200 00 1d 00 5c 00 4d 00 75 00 73 00 69 00 63 00 5c |...\.M.u.s.i.c.\|
//00000210 00 63 00 65 00 64 00 69 00 70 00 5f 00 74 00 75 |.c.e.d.i.p._.t.u|
//00000220 00 72 00 5c 00 74 00 72 00 61 00 6b 00 74 00 6f |.r.\.t.r.a.k.t.o|
//00000230 00 72 00 69 00 73 00 74 00 5c 00 30 00 31 00 2d |.r.i.s.t.\.0.1.-|
//00000240 00 65 00 6b 00 69 00 5f 00 61 00 5f 00 74 00 74 |.e.k.i._.a._.t.t|
//00000250 00 61 00 72 00 5f 00 2d 00 5f 00 68 00 79 00 76 |.a.r._.-._.h.y.v|
//00000260 00 e4 00 74 00 5f 00 68 00 65 00 76 00 6f 00 73 |...t._.h.e.v.o.s|
//00000270 00 65 00 74 00 2e 00 6f 00 67 00 67 00 00 00 00 |.e.t...o.g.g....|
//00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
//*
//00000400 00 1d 00 5c 00 4d 00 75 00 73 00 69 00 63 00 5c |...\.M.u.s.i.c.\|

//The song's filename is \Music\cedip_tur\traktorist\01-eki_a_ttar_-_hyvät_hevoset.ogg, and the (one-based) index of its first non-directory character is 29 (00 1d). Again, the frame is padded with zero bytes to contain exactly 512 bytes.

foreach (string songPath in songList)
{
if (songPath.Length > 255)
{
tsStatus.Text = "song path too long, skipped";
}
else
{
// Assume we have something like X:\Music\folder\song.mp3
// We want \Music\folder\song.mp3
// 123456789012345 with offset = 15
byte[] song = Encoding.BigEndianUnicode.GetBytes(songPath.Substr ing(2));
int offset = songPath.LastIndexOf("\\");
// offset is ok. +1 for / +1 for 1 based counting, but -2 for "X:"

byte[] offsetBytes = BitConverter.GetBytes(offset); // using two bytes only
byte[] pad = new byte[510 - song.Length];

bw.Write(offsetBytes[1]); // just 16 bits for offset, big endian
bw.Write(offsetBytes[0]);
bw.Write(song);
bw.Write(pad);
bw.Flush();
}

}
tsStatus.Text = "Created: " + plaName + " [" + songList.Count.ToString() + " songs]";

}
catch (Exception ex)
{
//Say("Error creating .pla file: " + ex.Message);
tsStatus.Text = "Error creating .pla file: " + ex.Message;
}

}
catch (Exception ex)
{
//Say("Exception: " + ex.Message);
tsStatus.Text = "Exception: " + ex.Message;
}
finally
{
if (null != bw) bw.Close();
}
//Say();

} // NewIriverPla
Reply With Quote

  #125  
Old 02-04-2010, 12:42 AM
Cyberian75 Cyberian75 is offline
Junior Member
 
Join Date: Feb 2010
Posts: 1
Default

Does this work for Sansa Clip+?

I converted my m3u playlists just fine, but the device (in MSC Mode) showed "empty" lists. However, they do contain paths and filenames.

Any ideas?
Reply With Quote

  #126  
Old 04-30-2010, 09:49 PM
Personator Personator is offline
Junior Member
 
Join Date: Apr 2010
Posts: 1
Default

m3u2pla program doesn't work and I get "failed to initialize properly" popup.
Reply With Quote

  #127  
Old 05-24-2010, 10:52 AM
kimberleybear kimberleybear is offline
Junior Member
 
Join Date: May 2010
Posts: 1
Smile Thanks!

It's been quite a while since you posted this, but I just wanted to say I've been looking for an application to trick my Sansa e260 into accepting a playlist forever and this finally did the trick. Thanks SO much--it's a small thing, but it makes my player that much more enjoyable to have something other than the Go List to cue up.
Reply With Quote

  #128  
Old 06-15-2010, 08:31 PM
besworkman besworkman is offline
Junior Member
 
Join Date: Jun 2010
Posts: 1
Default

I downloaded the program and saved it to my computer. it converted the m3u playlist to a pla, but my computer and mp3 player (sony) do not see it as a valid file
Reply With Quote

  #129  
Old 04-22-2014, 03:16 AM
cryss cryss is offline
Junior Member
 
Join Date: Apr 2014
Posts: 1
Default

Let's up up up this interesting topic !
I have a Nokia Lumia 925, running with WP 8.
I used to listen to music from time to time... and it was a pity to discover that the oem music player does not manage playlists ! (mainly I have m3u type)
After a quick search over the specialized forums, nothing interesting. Most of the people are recreating their own playlist on their mobile: that way you have to add manually one after the other... insane lost of time.

I went back to my search and find this topic.
I just try to run the .exe m3u2pla and it's working fine. Then I copied the mp3s and the playlist in my Lumia.
I tried it right away but it seems like the playlist is visible on my phone. I know the type of file is right because I had no message during the transfer. For instance, when the original m3u playlist were copied this the related album, I had a popup asking me if I wanted to skipped the m3u file as it is not recognized or if I wanted it anyway.

This is crazy to be in 2014 and Windows Phone not fine with m3u or whatever kind of playlist format... :/
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 01:37 PM.