© Copyright 2010 All Rights Reserved
The information on these pages is copyrighted by the author with all rights reserved. Reproduction of anything other than actual URL addresses without the author's permission is in violation of copyright laws.
This page covers various tips and tricks you can use with certain portable music and video players and Open Source software.
I really don't use my Walkman MP3 player or Zune. They just sit around most of the time. When I saw a book in the library that promised it could show me ways to make better use of my Zune, I decided to check it out. It mentioned a lot of free software which I probably wouldn't want, but the only new technique it mentioned that I hadn't thought about was using a freeware program like jpegbook to read books on your Zune. The Zune originally didn't come with any reader software to view PDF files. Now, luckily, there is a finally an e-book reader available for the device. However, you still may not be able to find the material you want in the proper format or use it easily with your own works. The technique mentioned in the book took a text file and converted it to JPEG graphics files with sequential numbering, allowing you to page through the pictures of the pages. It used a freeware program to do so.
I personally prefer to use Open Source over the average freeware or commercial programs simply because it comes with source code, so if I want to make some slight modifications or bug fixes I can. I thought there must be some clever tricks I could do with Open Source with my Zune HD. I already found a way to use Open Source to copy a soundtrack to my MP3 player. I know lots of programs that can convert file formats. I figured there must be some Open Source programs out there that could be used to create your own graphics of e-books.
After some experimentation, here's what I came up with. If you work with Imagemagick (or Graphicsmagick), you can convert PDF files to JPEG. One such command using Imagemagick is:
convert mypdf.pdf mybook%03d.jpg
You can do this with any PDF, but unless the font is really large, odds are you won't be able to read the converted files very well on your portable player. The output is numbered starting from 000 and increasing consecutively instead of from 001 as most portable players will probably expect. You can rename all your files with some batch scripts or make sure the first page of your PDF is something you don't need like a title page or empty page. There's more information on converting formats like text to images at the Imagemagick site.
If you have a file in postscript format, you can convert it to PDF using a program that comes with Ghostscript called ps2pdf. The jpegbook program that the book mentioned converted text to JPEG. I wanted a way to get from some file format I could work with to PDF and then JPEG. There's a really nice program called wkhtmltopdf that will convert HTML to PDF. I experimented with it and found the following gave reasonably good output for one of my stories in HTML.
wkhtmltopdf -O Landscape -B 0 -L 0 -T 0 -R 0 mystory.htm mypdf.pdf
I did make a few changes to my standard story format for the web in order to make the output more readable. Instead of my normal cascading style sheet, I used the following:
body { color: #000000; background-color: #ffffff; background-image: none; } p { text-align:justify; text-indent: 1.2em; font-family: 'Times New Roman',serif; font-size: 54pt; margin: 0em; padding: 0em;}
I can also add HTML tags to get a page to break where I want. For instance, I can add a page break so that nothing occurs on the first page which can help correct graphics numbering issues with important information starting on page 1 instead of 0. To do so, add the following in your HTML page where you want the page break to occur:
<div style="page-break-after: always;"><span style="display: none;"> </span></div>
So, if you follow the steps in reverse, apply a style sheet to an HTML file (or edit the HTML to change the font size), run wkhtmltopdf on the HTML file to create a PDF and then run convert on that to create JPG files, you end up with a fairly readable story. I thought the final output was better than the freeware I experimented with. You can experiment with the HTML styles to make the output more to your liking. You can also try alternative conversion programs with convert. Programs like Open Office writer will output to PDF, so if you can specify a large enough font, you should be able to turn a text file into a readable output. There are also programs like a2ps and enscript that can convert text to Postscript.
By the way, if you compress your graphics files into a zip file and change the extension to cbz, you can also view the zipped file on your PC with a standard comic book reader (such as Comical).
Personally, if your portable player has an Internet connection and you are able to connect easily enough to the Internet, I find reading the stories online in a simple HTML format is a lot easier than going to all the trouble to convert your story. A story that runs about 30 pages creates 132 pictures and about 17 Meg. So, this technique could take up a lot of space and it's not as quick as pointing your browser to the pages you want to read. However, if you're offline and want some way to read material on a portable player that can view graphics, it does give you an option.
What else can you do with your portable players? I have an article on creating your own midi files with abc2midi and Timidity. You can use Audacity to convert them to MP3 format and add your own personal music to your player. I also have an article on creating your own DVDs. You can use many of the Open Source video applications you need to create a DVD to create files for portable video players. For example, use a program such as vstrip or Project X to get demultiplexed MPEG 2 files from home movie DVDs you've created. You can do some minor editing with MPEG2Schnitt. If you're not on Windows, there have been reports of it working under Wine. You should be able to convert the MPEG 2 files to other formats like MP4 using programs such as ffmpeg or mencoder (from mplayer). If you prefer GUIs, there's a front end for ffmpeg called winff. Once the video is in the proper format, you can copy it to your player. If you just want the audio track to listen to on an audio player, you can use a program like a52dec to convert it from ac3 to wav. Then use a program like audacity to convert to MP3 or OGG Vorbis or Flac (lossless compression). I'd like to eventually post some command line examples for these, but I haven't had time to experiment that much yet. I'd be interested to hear if anyone else has seen some good examples for how to convert to more useful formats with Open Source.
I recently found out about this project for the Zune, so it may provide a way to get some custom programs to my player. Of course, if you have Internet access on your player, I find it more cross-platform portable and much easier to just write a program for a web site (using Javascript or a language like Perl with CGI) and access the functionality that way. Check out some of the sites that give examples on what you can do with Javascript to find some interesting code to try out on an Internet accessible player.
Other things I've used my players for are to download podcasts (audio and video), radio plays, public domain videos and listen or watch them. I guess a lot of people like having a front end, such as the Itunes program or Sonic Stage or the Zune program, but I find it easier to save the URLs of the podcasts or other resources I'm interested in and download what I want when I want. You can go straight to the web sites that provide podcasts or subscribe to their RSS feeds with an RSS reader. It seems a lot easier to dig up content that way rather than make it yourself from scratch, since most of it is already in an accessible format. Of course, the quality of the material varies quite widely. If anyone wants to compare interesting online resources they've found, such as helpful podcasts, feel free to carry on the discussion on one of my mailing lists. I'd rather not add the URLs to this page, because they change often. However, I'd be happy to mention some of the sites I've found for story archives, e-books, podcasts, radio-style plays, etc. on one of my related mailing lists.
The last thing I wanted to cover and something on my wishlist is a replacement for those programs that companies supply with your hardware so you can sync your player to your PC resources. I really dislike the commercial programs. I feel like I have no control over when they're going to start deleting files on my PC, especially if I decide to remove the software and it's using some folders I have materials in. This is one of the reasons I much prefer Open Source. I have already lost personal files using some of these commercial programs. Without the source code, I can't go in and make sure some directory doesn't get deleted whenever the developers please. So far, I've found about 4 Open Source libraries to access portable players. There's libgpod used with iPods. Programs like gtkpod make use of it. There's libmtp. They're working on adding support for the Zune and currently have some limited support. Was surprised to find it might also work with some phones too. If you check their web site at Sourceforge and look at the Downstream tab, you'll see a list of several programs that make use of libmtp. I've tried to compile gMTP (which also uses libmtp) on Windows myself and am still experimenting with it to see if it's helpful. There are also libifp for iRiver devices and libnjb for njb devices. I don't think any of these will work with my Walkman MP3. I'd love to find some alternatives for that player too, especially some in C/C++. There are some other solutions I'll mention below that are currently available for the Walkman. Would be very interested to hear if anything further develops in some of these Open Source areas that might improve connectivity.
My Walkman player is a NW-E507. I really had not checked for software updates since I bought it. However, while searching for replacements for Sonic Stage, I found out that there where some very nice upgrades available at the Sony support site. The drawback is that they don't appear to have support for Windows 7 and only limited support for Windows Vista. There is a firmware update available (from 1.0 to 2.0). It adds an extra clock to the display options and allows you to download and add one of two other display options, an aquarium or twinkling stars (stardust). To update the firmware, you need a computer, specifically a Windows XP, ME, 98 SE or 2000 machine. If you don't have Sonic Stage on the machine, you'll need to download and install it first. Once that's done, you can follow the instructions at the support site to update your firmware. It's recommended you back up all your data before any updates so you don't lose anything important. You can view the files on your Walkman through Windows Explorer. Just copy all the files from the player to a spare directory on your hard drive. After your firmware is updated, if you've borrowed a machine with the proper version of Windows for the update, you can remove Sonic Stage (plus two OMG applications) from it using Add or Remove Programs from the Control Panel. You can also remove the firmware upgrade software. Once you've updated your player, that's it. You don't need to do it again.
There is an update to Sonic Stage at the support site and it works on Vista as well as earlier versions of Windows. There's no Windows 7 support as of the last time I checked. I can't help wondering if the upgrade to Sonic Stage will work with my Sony computer with built in TV tuner or whether it's incompatible and shouldn't be upgraded. I haven't found any useful information on that yet. Not being a fan of Sonic Stage or really any of the extensive music manager programs out there, I was very happy to find out there was another way to copy music to my player. You can install the MP3 File Manager application. Again, it works on Windows 98 SE through XP, but I see no support for Vista. If you run the program, it'll install a portable file manager right on your device. However, the file manager doesn't work out of the box. You need to install the device manager on the computer you want to work with before the file manager will work with that machine. The device manager supports the same operating systems as the program to install the file manager. If you have all your files already stored in ATRAC format, the support center also offers a MP3 Conversion Tool for Windows XP and Vista. You'll need SonicStage (or at least the OpenMG applications that come with it) on your machine to use the tool. The tool works on ATRAC files you've created (usually with SonicStage), not ones you've downloaded with copy protection. So, if you want to switch all your files over from Sony's ATRAC format to standard MP3 files and don't mind the effort and time involved, it's now possible to do so. You can also add your current MP3 files directly with the device driver and MP3 File Manager installed.
What do you do if your operating system isn't supported by the Sony programs and drivers? There are some Open Source alternatives in the works. The most promising I've seen so far is JSymphonic. It's highly cross-platform portable thanks to being written in Java. However, that means you'll need the Java runtime environment installed to use it and I personally find applications using the JRE or .Net tend to run much slower for me. There was mention in the JSymphonic code and in a couple of posts about the possibility of a C++ library for accessing Walkman devices being created in the future. I couldn't find any tangible details, but it's definitely something I'd look forward to seeing.
So, my portable players are still probably going to sit around most of the time. I have a portable CD player that I really prefer for music and I can watch high definition DVDs or other videos or even TV on my laptop as well as read e-books, listen to music in a variety of formats, record audio and video, access the Internet and create programs. At this point, I still feel more comfortable with those devices than my portable players. However, I'd be very interested to hear if anyone has further clever uses for portable players and am especially interested in the Zune and the Walkman, since I already have them. If I come up with any other useful Open Source tips for portable players, I'll add them to this page and mention your name. Feel free to contact me on a related mailing list, if you want to discuss any of these topics further or offer some suggestions and tips of your own.
To an article on creating books from text files.