Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-15-2011, 08:27 PM   #1
SteveEisenberg
Wizard
SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.
 
Posts: 1,595
Karma: 11390088
Join Date: Jun 2008
Location: Philadelphia USA
Device: Kindle Keyboard 3G
Is There A Secret to Changing the Order Music Files Play In?

As background, I have a tiny personal little VB .NET 2010 Express program that automatically deletes those annoying notices (including the new ones for library books) whenever I attach my Kindle to my PC and press the annointed multi-key combination. I'm thinking that I might buff this up a little and make it my first freeware release since the days of the Apple II. Along those buffing up lines, I added a feature to randomize music tracks. My code goes through each MP3 on my K3, picking the music files at random and giving them a treatment like this:

My.Computer.FileSystem.CopyFile (strOriginalFilePath, strTempFilePath)
My.Computer.FileSystem.DeleteFile (strOriginalFilePath)
My.Computer.FileSystem.RenameFile (strTempFilePath, strOriginalFileName)

This does seem to reset the order in which the MP3 tracks play. And the whole process would be fast -- except that the CopyFile line above takes roughly forever AKA many seconds for most tracks. I could try doing an API call file copy, but I don't think it will much help, as doing a similar copy with Windows Explorer takes at least as long.

Maybe this is just how it has to be, in which case I will give the user an up-front estimate of how long it will take to randomize their songs before proceding. But before I do that -- does anyone know, at the lowest level, how the Kindle decides which order to play the songs? It seems there should be way to change some file characteristic that determines the order, rather than re-copy the whole track.

Thanks for all ideas.
SteveEisenberg is online now   Reply With Quote
Old 10-15-2011, 11:15 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,607
Karma: 4440239
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
Might just be based on the timestamps, in which case touch would be your friend, if you were on an Unix system . But I have no idea, never really used the MP3 player.
NiLuJe is online now   Reply With Quote
 
Enthusiast
Old 10-16-2011, 10:46 AM   #3
SteveEisenberg
Wizard
SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.
 
Posts: 1,595
Karma: 11390088
Join Date: Jun 2008
Location: Philadelphia USA
Device: Kindle Keyboard 3G
Quote:
Originally Posted by NiLuJe View Post
. . . touch would be your friend, if you were on an Unix system . B
You know, when you tell an old-time Basic programmer that there's something a sexier platform can do VB can't, it gets the juices flowing . . .

Anyway, I tried updating, from code, each of the following attributes to see if it changed the order of play for an MP3:

-- LastAccessTime
-- CreationDate
-- LastWriteTime

No effect!

Than I tried toggling these attributes:

-- Offline
-- Hidden
-- Encyrpted

Nothing. It may be that the Kindle doesn't even store some of these, although changing them raises no error.

Renaming, and then renaming back, also made no difference.

Last, I tried to change 1 random byte in a MP3 and then change it back, since this can be done far faster than reading and writing an entire file. Actually, I didn't do that in VB, since I had forgotten how, but, as proof of concept, did it using the XVI32 freeware hex editor. No effect.

So, at least for now, I'm going to stick with the slow full rewrite of all MP3's. Last night, when I had 97 MP3 files, totalling 693 MB, on my K3, full track randomization took 9 minutes. The good part is that, in the help, I can assure users that the program is safe because it only does what they can, and probably would, do manually with Windows Explorer. Plus, few MP3 users will actually tolerate something that slow, so if asked for MP3 support, I'll have time to give it

I just realized that I can also provide a simple rewind feature, although it will take just as long as track randomization.

Last edited by SteveEisenberg; 10-16-2011 at 10:48 AM.
SteveEisenberg is online now   Reply With Quote
Old 10-16-2011, 01:13 PM   #4
akleiw
Member
akleiw began at the beginning.
 
Posts: 19
Karma: 12
Join Date: Sep 2011
Device: Kindle 4.1.0
Hi,
I guess the files on Kindle are played in order they are listed in FAT directory table. Here is a nice example (unfortunately in C++) on how to modify it.

By the way, Drive Sort or any of the applications listed here can sort mp3 files according to their file names.
akleiw is offline   Reply With Quote
Old 10-16-2011, 03:32 PM   #5
SteveEisenberg
Wizard
SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.
 
Posts: 1,595
Karma: 11390088
Join Date: Jun 2008
Location: Philadelphia USA
Device: Kindle Keyboard 3G
Thank you. You nailed the answer to my programming question.

Quote:
By the way, Drive Sort or any of the applications listed here can sort mp3 files according to their file names.
What this means, for me, is that the music side of my program already exists. Since the idea of something to auto-delete notices, on a non-rooted Kindle, is still, as far as I know, original, I'll go for that.

Trying, with my Vista 32 bit PC, six of the eight programs on your last link above, against my Kindle Keyboard 3G, still at firmware version 3.1, here was my experience, going from bad to good:

FatSort 1.0.6 - I could not get this to work. Maybe it requires an old PC using FAT, such as one running Windows 98.

MP3DirSorter 1.0 - Strange user interface. I could not get it working.

FatSorter 1.0.4 - Works, but only sorts ascending by name.

FatSorter AKA Alphanumeric Fat Sorter 1.0 - Works. Only sorts ascending by name. Has possibly unique feature that is really good, or really bad, depending on your needs: It realizes track 7xxx.mp3 goes before 10xxx.mp3.

Drive Sort - Works. Sorts by name, ascending or descending. No shuffle/randomize feature.

Re-Organize! 2.3.1 - This is the one I recommend. It does everything I might want in terms of organizing the music on my Kindle, other than to do it while disconnected from a PC. You can sort by name, or by file date, or randomize, or drag and drop to put MP3's in the exact order desired.

I didn't test the other two programs. FATSortUtility requires Linux, which I don't have. YAFS sounds flexible but has a command-line interface that looked time-consuming.

Last edited by SteveEisenberg; 10-16-2011 at 03:49 PM.
SteveEisenberg is online now   Reply With Quote
Old 10-18-2011, 04:10 AM   #6
ryran
Connoisseur
ryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with othersryran plays well with others
 
Posts: 79
Karma: 2718
Join Date: Aug 2011
Device: Kindle 3G
I know every programmer thinks his favorite language is the best tool for every situation, but damn this would be so easy to do on a nix system with bit of BASH scripting. Are you seriously COPYING and then deleting each track? My mind is blown.

In other news, I couldn't stand the limitations of the built-in mp3 player, including lack of ability to sort or choose tracks. After rooting and installing mplayer + kinamp, I'm totally happy.
ryran is offline   Reply With Quote
Old 10-18-2011, 01:07 PM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,607
Karma: 4440239
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
A quick check in the Portage tree turned out fatsort. If it builds on ARM, it might be usable natively on the Kindle.
NiLuJe is online now   Reply With Quote
Old 10-18-2011, 10:07 PM   #8
SteveEisenberg
Wizard
SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.SteveEisenberg ought to be getting tired of karma fortunes by now.
 
Posts: 1,595
Karma: 11390088
Join Date: Jun 2008
Location: Philadelphia USA
Device: Kindle Keyboard 3G
Quote:
Originally Posted by ryran View Post
I know every programmer thinks his favorite language is the best tool for every situation
My favorite language is Transact-SQL, and you definitely cannot do everything with that. I just say that there is nothing you can do with C++ that you can't do with VB (although in the VB6 days, you, on rare occasion, needed a third-party product to do it.) My knowledge outside the Microsoft world is extremely limited, which is why I'm experimenting from a different angle than you guys.

Quote:
Are you seriously COPYING and then deleting each track?
Not any more. But it did, slowly, work.
SteveEisenberg is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 Is there a way to be able to get ALL my music files to play... kelliedn Sony Reader 6 03-04-2011 11:51 PM
Play Order Soxendom Calibre 4 01-02-2010 01:36 PM
E-Book reader for music play usage t-mies Which one should I buy? 10 06-16-2009 08:07 PM
Play.com (UK) now have the PRS-505 up for pre-order simond News 3 08-15-2008 10:16 AM


All times are GMT -4. The time now is 09:18 PM.


MobileRead.com is a privately owned, operated and funded community.