How I make audiobooks from text and pdf files

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

How I make audiobooks from text and pdf files

#1 Post by jrb »

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, 23:22, edited 3 times in total.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#2 Post by jrb »

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.

4.) Download TextToWavSetup.exe from http://smart-butler.com/download.html#text2wav. There are sample voices lower on the page although some of them are no longer available.

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.
Attachments
file2aud-0.03.pet
convert pdf, text, or script files to mp3 or choose audio readout
(29.78 KiB) Downloaded 309 times
pdftotext-w5c.pet
needed to use pdf files in wary 512, 514
(7.55 KiB) Downloaded 335 times
Last edited by jrb on Mon 21 Nov 2011, 18:27, edited 4 times in total.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#3 Post by jrb »

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

http://www.gutenberg.org/wiki/Main_Page is an excellent source of free ebooks and also http://www.baen.com/library/.

Hope you enjoy the end products of this technique as much as I do. Enjoy, J :D
Last edited by jrb on Tue 08 Nov 2011, 00:10, edited 2 times in total.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#4 Post by 8-bit »

How much drive space does this take to install all before using it?

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#5 Post by jrb »

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.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#6 Post by 8-bit »

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!

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#7 Post by jrb »

8-bit wrote: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.

ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

#8 Post by ITAmember »

The dll files are also in C:\Windows\System32 on Windows 7, that means they should also be included with Vista.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#9 Post by jrb »

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. :D

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#10 Post by Roy »

Installing the British voices (male and female) gives

Code: Select all

fixme: jack: JACK_drvLoadto use jack error loading the jack library libjack.so.0, please install this library 
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.)

Thank you for this, jrb!

-Roy

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#11 Post by jrb »

Your welcome Roy,

Which version of wine are you using?

User avatar
linuxsansdisquedur
Posts: 248
Joined: Tue 13 Jan 2009, 21:17
Location: South of France

#12 Post by linuxsansdisquedur »

le max avec le min

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#13 Post by jrb »

linuxsansdisquedur wrote:have you seen http://vozme.com/bookmarklet.php?lang=en
No I hadn't. The female voice isn't too bad. I'm afraid my internet speed is too slow to send much text at a time.

Thanks, J

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#14 Post by Roy »

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/viewto ... 0dc63fccda 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.

-Roy

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

New version of file2aud tools

#15 Post by jrb »

I have just posted a completely new set of file to audio tools. See page 1.

Enjoy, J :D

User avatar
mouldy
Posts: 663
Joined: Wed 04 May 2005, 21:47

#16 Post by mouldy »

I havent tried making the software work, but did listen to the sample voices to see if I could tolerate them.

Of the SAPI4 voices, I could somewhat tolerate the British female. Not really any of the others. Dont know that I could listen to a whole book read by it though.

No way to get SAPI5 voices to work? NeoPaul was pretty good with NeoKate not far behind.

Oh and which version of text2wave? 1.4 or 1.5beta?

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#17 Post by nic007 »

2nd Speech Center works perfectly for me in puppylinux 4.12. I installed an older version of wine 1.12 (or there abouts), sapi4 and Tru Voice American English. 2nd Speech Center reads many file formats and saves to mp3. I use the Peter voice, speed at 162 wpm. The pronunciation editor is very good (works better than textaloudmp3) and I have spent a bit of time incorporating wordslists to get it to a very good standard of listening. Also, I would advise just to replace exclamation marks with fullstops in the pronunciation editor as exclamations sounds awful with this engine. This speech engine has a few downfalls eg. can`t distinquish between nouns and vowels of the same word eg. wind, many compound words are not pronounced correctly (this is where you need to take some time and incorporate some wordlists into the editor), some abbreviations also cause problems. A good example of the latter is the abbreviation in. (inches) which causes a sentence ending with in. to be pronounced as inches. Again there is a way to rectify it. In the pronunciation editor make in. be pronounced as inn.

I have not tried sapi5 but I don`t want to as I have managed to get the Tru Voice engine to work for me at a very good and enjoyable standard.

2nd Speech Center is not free though. Balabolka looks a good alternative and is free but I haven`t tried it.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#18 Post by jrb »

mouldy wrote:Of the SAPI4 voices, I could somewhat tolerate the British female. Not really any of the others. Dont know that I could listen to a whole book read by it though.
My internet is too slow to listen to the samples but I have listened to Lernout & Hauspie Adult Male #2 (American English) for up to 15 hours on long car rides. Sounds better in my earbuds than through computer or car speakers.
No way to get SAPI5 voices to work? NeoPaul was pretty good with NeoKate not far behind.
As I recall I couldn't get SAPI5 to install in wine but I haven't tried recently.
Oh and which version of text2wave? 1.4 or 1.5beta?
I'm currently using 1.5beta, started out with 1.4 but I haven't noticed any difference.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#19 Post by jrb »

nic007 wrote:2nd Speech Center works perfectly for me in puppylinux 4.12.
Nice to know, I started out using Textaloud but it kept crashing in wine. I miss the pronunciation editor.
2nd Speech Center is not free though. Balabolka looks a good alternative and is free but I haven`t tried it.
I tried Balabolka but as I remember it didn't work well in wine.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#20 Post by jrb »

I just uploaded file2aud-0.03.pet which has a correction :oops: in cp_usbplayer for copying the mp3 files in sequence onto your mp3 player.

Post Reply