Posted: Fri 02 Apr 2010, 01:11 Post subject:
How I make audiobooks from text and pdf filesSubject description: Use freeware to create audiobooks

7Nov2011
I have just completely rewritten my text-to-audiobook software. Puppy (all versions) now comes with pdftotext which allows the easy conversion and use of pdf files. As well I have built in the ability to place a "trill" at the beginning of each MP3 file and easily choose the length of the files in seconds. You can also choose to have the file read aloud rather than made into MP3's.

The install is still the same up to the point of installing my file2aud tools. I will leave the old tools in place in case anyone prefers them but you should try out the new ones!

I have long been a fan of audiobooks going back to the days of audio cassettes. Many's the long car trip they have kept me awake through. With the advent of the mp3 player it became possible for me to listen to stories while doing the numerous no thought required tasks of rural life.

Prior to Puppy I used a windows program, TextAloud, to create audiobooks from text files. It did an admirable job with a voice that I could listen to for several hours at a time, reminded me of my whiskey throated uncle. It runs intermittently in wine, crashing frequently and requiring restart.

It became my goal to get a dependable technique going in Puppy using freeware, preferably open source. Sadly I have not been able to find any open source voices that I can listen to for more than a few minutes, but I have found freeware that allows me to use my old favourite, Lernout & Hauspie - Adult Male #2, American English (TruVoice), SAPI4.

In the following HowTo I will explain where to get the software, including voices. How to install it. And I am attaching my txt2audbk-splt-0.3.pet which contains the tools I use to create books.

I have accumulated a collection of primarily science fiction books. They have all been converted to Text files and then zipped. I am including tools to make books from both text files and zipped text files. Also tools to speak text, or any text containing, files direct, make single mp3 files direct, batch convert a folder full of text or zipped text files. Also a SAPI voice chooser allowing you to set the voice you wish these tools to use. Also a tool to replace spaces in file names with underscores, this is important as files with spaces will not convert. Also a tool to copy the folders containing your audio books to your mp3 player so the files are copied in the order they are meant to be played.

Ok, Let's begin the HowTo:Last edited by jrb on Mon 07 Nov 2011, 19:22; edited 3 times in total

1.) You will need to install Wine. You can get the latest version for Puppy from here

2.) Open a console and type "winecfg". This will create the folder /root/.wine where all your windows based programs will go. This is a hidden folder so you will need to enable seeing hidden files and folders, click on the eyeball on the rox toolbar.

3.) Find a windows XP machine and copy wmasf.dll, wmidx.dll, wmvcore.dll from C:\WINDOWS\system32\ to /root/.wine/drive_c/windows/system32. These are needed by the windows sofware you will be running.

5.) Once downloaded, click on TextToWavSetup.exe to begin the install process. I simply accepted the default settings until I got to where it asked, "Which components should be installed?".

6.) Choose "Download and install Microsoft Speech API 4.0 core

7.) Choose "American English" under Lernout & Hauspie voices or any of the SAPI4 voices

8.) Decline API5.1 (I have not been able to get the SAPI5 software to run)

9.) Decline American English SAPI5

At this point the program will download and install the software. You must be connected to the internet for this to succeed.

You should now be able to go to /root/.wine/drive_c/Program Files/TextToWav/ and click on TextToWav.exe. This will run the TextToWav GUI and you can type in or copy and paste in text and have it spoken or saved to a .wav or .mp3 file. You could make a single file audiobook file right here but I think you will find my toolkit much more suitable.

Revised 7Nov2011
Audio Book Tools:
Start by installing file2aud-0.02.pet. This will install a number of tools. I will go through them individually.

1.) SAPIvoice_chooser - This is on the Multimedia menu. Click on it and it will show you a list of all the installed voices. Click on a voice and then on the Listen/Choose button. The GUI will disappear and the voice will speak to you. The GUI will then come back. If you liked the voice click the Done button, otherwise listen to another voice. The last one you listen to will be installed as the default for your system.

2.) rm_space - This is available on the right click menu. Right click on a .txt file and you can replace any spaces in the file name with underscores. Right click on a folder and choose rm_space_within and you can replace any spaces in the files it contains with underscores. Right click on anything else, go to OpenWith and choose rm_space and it will replace spaces with underscores. The new file2aud tools will now deal with spaces in file names but its still a handy tool.

3.) Right click on any .pdf, text containing file, zipped text containing file or a directory containing these kind of files and a small GUI will open up allowing you to choose A.)whether to just read the file aloud B.)how long to make the MP3 files C.)whether to add a 1 second "trill" the beginning of each MP3.

The resulting MP3 files will be placed in folders named after the file(s) all in a folder named file2aud_mp3s.

4.) cp_usbplayer_rxvt - You must create a file on your mp3 player named 00mp3. Once you have done this, if your mp3 player is mounted, you can Right click on a folder and choose cp_usbplayer. If the folder contains .mp3 files that have been created with these audio book tools, the same folder will be created on your mp3 player and the files will be copied sequentially into it. Since some mp3 players can only handle up to 99 files per folder another folder with the same name but with a 2 appended on it will contain files 100-198. Similarly other folders will be created up to a maximum of 495 files per book. (41hrs 15min, War and Peace might be a problem. Let me know and I'll customize for you)

If you right click on a folder containing other folders containing the .mp3 files (after a batch conversion) then each of the book folders will be copied to your mp3 player.

Note: I have tested this successfully in Wary 5.1.2, 5.1.4, 5.2, Racy 5.1.110, Lupu 5.28 and Slacko 5.3. It also worked in Puppy431 with a statically built version of pdftotext

Good question 8-bit,
I just looked at my quirky13 install and it appears to be using about 160MB of the pupsave. Thats with the latest wine-1.1.41-i486.pet and everything contained in the pupsave. I convert all my files in folders on /mnt/'home. My /mnt/home is ext3 so I just tried a quick convert on an ntfs drive and it worked fine.

I also just tried a timed test. A 532 Kb text file, which is fairly typical of full sized novels, took 6min 5sec to convert to an audiobook. Thats on my 5 year old pentium4 3.0GHz machine.

As a caution, on step 3 to copy Windows dll files for use by the program, I would suggest that anyone that makes a custom Puppy not include this as Microsoft gets really upset if they find some distro is using any of their files!

As a caution, on step 3 to copy Windows dll files for use by the program, I would suggest that anyone that makes a custom Puppy not include this as Microsoft gets really upset if they find some distro is using any of their files!

Agreed, one shouldn't redistribute these files, which is why I have not included them in my .pet. However, if you already have a windowsXP installation on the same machine you are entirely legal. You can even symlink wmasf.dll, wmidx.dll, wmvcore.dll from C:\WINDOWS\system32\ to /root/.wine/drive_c/windows/system32 rather than copying them.

BTW, I just checked a win2k machine and those same files are in c:\WINNT\system32. I don't have access to vista or windows7 but I suspect they are still in \system32 there as well.

Just a little side note here. My wife, who suffers from smoke induced asthma and bronchitis, has recently been laid low by some slash (brush) burning in our area. When she tries to talk she breaks out in nasty coughing. I installed the TextToWav software on her computer and she is now talking to me with the GUI on the multimedia menu. Actually quite effective.

I think simply creating a blank file in /usr/lib/ named libjack.so.0 will suffice and allow British voices to work. (I actually did a long string of other -- unnecessary -- things before the British voices functioned, but think this was the basic end result that worked.)

I deviated a bit by using wine-1.1.42-i486.pet and the latest beta version of smart butler's text to wav. The American English voices worked after following your instructions (if my memory serves correctly), but the British languages I added did not. So I ran it from the terminal and saw the nag for jack with those voices.

What I had actually done was locate jack-audio-connection-kit-0.109.2.pet in this thread: http://www.murga-linux.com/puppy/viewtopic.php?t=24246&sid=187b260dfe4f7f8c1960190dc63fccda and installed it. Then running the 'ln -s /usr/lib/libjack-0.100.0.so.0 /usr/lib/libjack.so.0' command in console creates a symlink to libjack-100.0.so.0 that is renamed libjack.so.0, right? (I am not an expert on this stuff.)

Everything now works, but a file system search for libjack-0.100.0.so.0 or any shortened variation comes up empty and a quick glance in my /usr/lib/ shows that it is not there. I basically created a blank file symlinked to nowhere with the console command previously mentioned. I don't think the .pet I installed contains jack and was an unnecessary move on my part. The other .pet mentioned by maegerlab on that thread is not available -- maybe it was the one with the jack library.

Having said all that, I have not found a SAPI4 which is as easy to listen to as your choice of Lernout & Hauspie - Adult Male #2, American English (TruVoice). I should also add that I am using a full install of Gray's Boxpup4.31 right now, although I doubt that makes much difference.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum