Tuesday, January 29, 2008

Text to Speech Software

After you've picked out a text that you'd like to listen to, it's time to convert that document to MP3.

Now, if you've picked out a particularly long document, such as the aforementioned Ulysses by James Joyce, you will most likely need to break the text up into separate documents to be made into separate audio files for manageable listening. You could either follow the natural structure of the book, separating the document into individual chapter text files, or do something more arbitrary, like breaking the document into separate files every 3050 pages.

Once you have your documents ready to go, you need a tool to convert them to MP3 format. A quick search of VersionTracker (http://www.versiontracker.com) will turn up a variety of shareware and commercial titles for Windows that will convert text files to audio files. If you conduct the same search on the Mac OS X end of things, you'll find several freeware titles in the mix. This is because Mac OS X has integrated text-to-speech support built into the OS. Here's how you can convert text to speech under Windows, Linux, and Mac OS X. Your end result will be an audio file that you can convert as described in the next section.

If you are on Windows, use a third-party text-to-audio program such as VoiceMX Studio (http://www.tanseon.com/products/voicemx.htm), load the text, and generate your output file (in the case of VoiceMX Studio, you'll get a .wav file). Next, convert the file to MP3 as described later in this hack, then take the resulting file and drop it in /PSP/MUSIC/ on your Memory Stick to listen.

Get the Text

Why buy audiobooks for your PSP when you can make your own?

You like books, but you don't particularly like the idea of reading your books on your PSP's screen. (If you do want to read books on your PSP, make sure you check out "Use Your PSP as an E-Book Reader" and "Create Your Own PSP E-Books".) You've been considering buying some audiobooks and listening to them on your PSP, but you'd rather spend those hard-earned dollars on games for your PSP. Why not simply make your own audiobooks for the PSP?

Don't worry. I'm not suggesting you sit down and read James Joyce's Ulysses out loud while recording it to MP3. Instead, just grab the text of Ulysses from Project Gutenberg (http://www.gutenberg.org/) for free and have your computer read the text to audio files.

You can get the text from any plain text file you have lying around, so don't be afraid to take that business report your boss wants you to review, convert it into plain text, and change it over to audio. Since the PSP is a recreational device, however, I am going to assume that you are looking for some actual reading entertainment.

If that's the case, a wide variety of options are readily available to you via the Internet. Both Project Gutenberg (http://www.gutenberg.org) and the Electronic Text Center at the University of Virginia Library (http://etext.lib.virginia.edu/) freely offer a variety of literary titles that have fallen out of copyright and entered into the public domain. The text section of the Internet Archive (http://www.archive.org/details/texts) contains texts that have entered into the public domain and others that have been released under Creative Commons licenses or are free from any sort of copyright. The Creative Commons web site itself features a text section (http://creativecommons.org/text/) that regularly highlights texts that have been released under Creative Commons licenses.

In addition to these resources, you can easily copy and paste the text of any web document into a .txt file, or even use an online RSS feed reading tool like Bloglines (http://www.bloglines.com) to display your daily dose of news items on one web page where you can select all, copy, and paste into a .txt file.

Additional Music Tips

If you are on a Mac running OS X 10.4, make sure you check out "Automate Mac OS X File Transfers" for instructions on writing an AppleScript to automate moving your tunes to your PSP. If you're savvy in other scripting languages, you may want to look over that hack, as well, for some ideas for your own automated script.

If you're running Version 2.0 of the firmware and you want to take full advantage of your networked music collection, you'll want to create a Music page that contains an index and links to all the files within your PSPMUSIC folder. This will allow for easy picking and choosing of songs you want to grab off of your network for on-the-go listening on your PSP. Why not build the same support system for a few videos, too?

Also, if you are homebrew savvy, make sure you check out some of the homebrew MP3 players available for the PSP.

Thursday, January 24, 2008

Using PSP as MP3 Player

Once you have your music on your PSP, it's time to listen. Here's a quick overview of the PSP's controls and functionality as an MP3 player.

To keep your music organized into albums, all you need to do is keep a group of audio files in a single folder by the name of the album placed within /PSP/MUSIC/ on your Memory Stick. The preview image associated with the Album folder will be taken from the image associated with the first file in the list of tracks contained within the folder.

Unfortunately, the PSP can only see folders one level deep here, so you cannot do things like create a folder called The Beatles, which you then fill with separate folders for each of The Beatles' albums. So, if you want to categorize by artist, make sure you keep all the song files within that main artist folder, rather than embedding folders within folders.

Navigate to Music Memory Stick and hit the X button to see a list of all the songs and albums located inside your /PSP/MUSIC/ folder. The folders will be listed alphabetically, followed by an alphabetical listing of any lone files in this root Music folder. Select the album you want to listen to and hit the X button.

A list of songs will appear, as you scroll through the different songs, you will notice that certain bits of metadata associated with the song files will be displayed, including the name of the song, the artist, and any album artwork associated with the song file. As with all the other files on your PSP, if you select one of the tracks and hit the Triangle button, a menu will appear on the right side of the screen with options for Play, Delete, or Information. If you select Information and hit the X button, the full list of all metadata associated with the track will be displayed, including the title, artist, album, genre, size, date and time it was updated, Length, Sampling Frequency, and Codec at which the track was compressed.

Otherwise, simply hit the X button to play the song.

Once the song is playing, you have a variety of options. If you hit the Triangle button while the song is playing, the control panel will open, displaying all the available controls.

If you are running a previous version of the firmware, some of the controls discussed in this section will not be available to you, although many of them will be identical.

The controls available in the control panel of Version 2.0 of the firmware are Previous Group, Next Group, Previous Track, Next Track, Fast Reverse, Fast Forward, Play, Pause, Stop, Group Mode, A-B Repeat, Play Mode, Clear, Display, and Help. Selecting the Display option adds an overlay along the top of the screen with the name of the track in the upper-left corner and the number of the track next to how many tracks are in this group in the upper-right corner of the screen. Selecting the Help option (the question mark) will display the basic Music Help screen . This screen shows you all the basic controls on the PSP for navigating through your songs. The L trigger goes to the previous track or the beginning of the current track, the R trigger goes to the next track, the O button stops play, the X button plays, the Start button either plays or pauses the track, and the left and right buttons on the directional keypad rewind or fast forward the track.

The Group controls all have to do with different albums or folders you have placed inside /PSP/MUSIC/. A-B Mode lets you select first an A point in a track and then a B point in the track, which will continue looping until you choose Clear. The Play Mode control lets you choose either Repeat One, Repeat All, Shuffle, or Repeat Shuffle, and if you toggle the Group mode selection, all of these settings (with the exception of Repeat One) will use all the files in your MUSIC folder rather than just the songs in the current album folder. The other options available in the control panel are mostly self-explanatory.

Firmware Version 2.0 and Music Playing

If you are running a PSP with Version 2.0 of the firmware, then you can download music from the Internet directly to your PSP's Memory Stick. This is particularly useful for grabbing new music and podcasts from various web sites while you're on the go and connected to a wireless network.

To do this, simply launch the web browser by navigating to Network Browser on your PSP, and hit the X button. After your browser launches, navigate to a page that contains links to audio files in a PSP-compatible format. Unfortunately, the PSP cannot handle compressed files, BitTorrent, or WMA (Microsoft with DRM format)unless you are running Version 2.6 firmware or laterso the files will need to be in uncompressed and unprotected MP3 or AAC format. When you click on the link to the corresponding audio file, an overlay screen will pop up asking whether you want to download the linked file. Hit the X button, as shown in.

If, for some reason, the PSP doesn't recognize the file type and tries to open the file as a website, cancel the loading of the page (hit the Triangle button and then select Cancel) and then go back to the original page (by hitting the L trigger). This time, place your cursor over the linked file, but instead of hitting the X button, hit the Triangle button and navigate to File, then hit the X button. A menu will pop up. Select Save Link Target from this menu and hit the X button.

Another overlay will appear asking for confirmation of the location where you'd like to save the file and the name you would like to give the file. If the location did not default to /PSP/MUSIC/, select that field, and hit the X button to select this folder (or a subfolder inside the MUSIC folder). Feel free to change the name of the file to something you will recognize. Just remember to keep the proper extension at the end of the file. If the file you are downloading is an AAC file, go ahead and change the extension on the file to .MP4 so that your PSP will recognize it.
After downloading the files, hit the Home button on your PSP to exit out of the browser. If you hit the button by mistake, you can either hit it again or hit the X button to return to the browser. Navigate to Music, select Memory Stick, and hit the X button. You should see your freshly downloaded audio files in the list of available tracks.

This method of grabbing songs can be particularly useful for serving up songs from your networked music collection on your home network. All you need to do is set up a networked folder containing any music files you would like to have ready for your PSP, then direct your PSP's web browser to this folder. For example, if your computer has an IP address of 192.168.1.4 on your local network, and you have a folder called PSPMUSIC that you have set up to be available to other computers on your network, you can launch the PSP's web browser and navigate to http://192.168.1.4/PSPMUSIC/nameofthesongyouwant.mp3 to download that song file. Consider building a music index page that links to all these files.

If you've installed Version 2.6 of the firmware, you now have an option called RSS Channel under Network. Now any RSS 2.0 feed containing embedded MP3s can be subscribed to through the PSP's browser, and all the songs on that feed can be streamed to your PSP over a live Internet connection through the RSS browser interface.

Saturday, January 19, 2008

Automatic Music Synchronization

Both PSPWare (http://www.nullriver.com/index/products/pspware; $15 USD) and iPSP (http://ipsp.kaisakura.com/; $19.99 USD)two of the more popular media managers for the PSPoffer automatic syncing of music to the PSP, using a playlist of your choosing from your iTunes Music Library. This is great if you use iTunes, but if you prefer to use different music managing software on your computer, these two solutions may not be ideal.

Again, keep in mind: these tools will only be able to manage iTunes playlists containing MP3s or AAC files that are DRM-free and have had their file extensions changed to .MP4.

The Basics

While you can cram a few MP3s on the 32MB Memory Stick Duo card that came with the PSP, you are going to need to invest in a larger Memory Stick to really get the most out of the PSP as an MP3 player. I recommend keeping an eye on Memory Stick pricing at DealNews (http://www.dealnews.com) or their sister site DealRam (http://www.dealram.com), since they regularly have links to 1GB sticks for less than $100 USD.

Once you have the extra space, you need to know where to put your tunes. If you mount your PSP on your computer (attach the PSP via a USB cable, navigate to Settings USB Mode, then hit the X button) you can simply copy the songs from wherever they reside on your computer to the MUSIC folder inside the PSP folder at the root level of the Memory Stick.

If you have a PSP with Version 1.01.52 of the firmware, then your PSP will recognize any MP3s placed within this folder. If you have a PSP with Version 2.0 of the firmware, your PSP will recognize any MP3s, songs in Sony's ATRAC3plus file format (although these files need to be in /OMGAUDIO/), and even files you have encoded with Apple's AAC format (although DRM-protected tracks purchased from the iTunes Music Store will not play on your PSP, and you will need to change the file extension of the AAC files you have encoded to .MP4 for the PSP to recognize these files).

Are you looking for a quick way to convert your iTMS-purchased songs to DRM-free AAC tracks? Simply burn the tracks to audio CD and then rip them back to your computer, making sure that you have AAC selected under the encoding section of the Advanced menu in iTunes.

If you want, you can use this method to manually manage the songs on your PSP: mount your PSP, copy the songs over to the MUSIC folder inside the PSP folder, dismount your PSP and navigate to Music Memory Stick, hit the X button, then select the song you want to hear and again hit the X button. There are, fortunately, easier ways to do this, described next.

Enhance your Movie Experience

You can encode any video you've filmed yourself or downloaded off the Internet, but one of the things that really adds value to your portable PSP viewing is the ability to time-shift your favorite TV shows onto it for portable viewing.

If you have a newer model TiVo with TiVo-to-go or any ReplayTV with an Ethernet port, you can easily transfer video from your digital video recorder to your computer over a local network connection.

With a lot of time and a modicum of effort, you can copy the contents of your DVDs to your computer and recompress your favorite videos into MPEG4 for watching on your PSP.

Of course, for each DVD you want to convert to MPEG4, you can expect to spend a good 512 hours of intensive processing time on your computer (depending upon your processor's speed). If you have the patience and the time to spare, then go for it. If not, consider going out to your local media outlet and buying the movie on UMD to help support the growth of the PSP platform.

Most DVDs use DeCSS encryption as a form of Digital Rights Management (DRM) to prevent widespread piracy. The problem with this solution is that besides not really being an effective means of preventing piracy, the DRM also gets in the way of law-abiding consumers like you and me, who only wish to exercise our fair use rights with a product we've purchased and own. This is a particularly nasty catch-22, and I recommend that you get involved with trying to undo this bad law. See the web site for the Electronic Frontier Foundation (http://www.eff.org/) for more information about DRM, and current and proposed laws that essentially (or potentially) infringe on your rights. Examples of potential threats include the "broadcast flag," which involves use of encoded signals in the content that trigger anti-copying features inside your very own home devices. Although an FCC rule requiring manufacturers to implement broadcast flag technology was overturned in court, its supporters are committed to resurrecting it.
See Wikipedia for more information: http://en.wikipedia.org/wiki/Broadcast_flag.

Wednesday, January 16, 2008

Using ffmpeg

The magic key to all the video compression at work in iPSP, PSPWare, and PSP Video 9 is actually a little bit of open source goodness that is developed under Linux, but which can be downloaded and compiled for either Windows or Macintosh: ffmpeg (http://ffmpeg.sourceforge.net/index.php). There are a variety of options you can set for encoding files with ffmpeg, but the basic procedure for converting your videos to PSP-compatible MPEG4 files via ffmpeg is:

ffmpegi example.movb 300s 320x240vcodec xvid \
ab 32ar 24000acodec aac example.MP4

The file following is the source file, so replace example.mov with the location and name of the file you are converting. b 300 sets the bit rate to 300kbps. You can make this number higher if you want higher-quality video, but keep in mind that the higher quality the encoding, the larger the file size, and if you go over 768kbps, the file won't play on your PSP. s 320x240 sets the pixel size for the video, and vcodec xvid forces the codec to be used to xvid.

The next set of instructions contains the audio settings for the encoded file.ab 32 sets the audio bit rate to 32kbps, andar 24000 sets the frequency to 24000 Hz, whileacodec aac sets the codec to be used to aac. Finally, you need to specify the path to the new file (example.MP4).

If you're on Mac OS X and you don't like the idea of compiling ffmpeg, you can always use ffmpegX (http://homepage.mac.com/major4/; Shareware $15 USD), which provides a GUI front end for ffmpeg and automates all these settings for you. Its most recent version, shown in Figure 3-7, even includes a PSP MPEG4 preset to make things easier.

Using PSP Video 9

PSP Video 9 (http://www.pspvideo9.com/) is a free, Windows only program for converting videos into MPEG4 files properly formatted for the PSP. PSP Video 9 can also be used to automatically transfer converted videos from your PC to your PSP, and can be used in conjunction with Videora (http://www.videora.com/) to automatically download, convert, and transfer videoblogs (such as Rocketboom) to your PSP.