Flite text to MP3

A home for all kinds of Puppy related projects
Post Reply
Message
Author
User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

Flite text to MP3

#1 Post by Geoffrey »

I came across flite text to speech in the request thread, and downloaded the files
to see what I could do with them, looks kind of promising, it isn't small somewhere around 14meg
with all the lib file's, the one thing I really like is the talking clock, sounds quite good with
a male Scottish accent, as for the text to speech that's kind of ok, well I can understand it, it comes
with 6 voices that's including the default one, not any way of changing speed that I could find so it's
fairly basic but useable.

It converts to a wav file or reads directly from text, I opted to convert to wav file so that I could store
them for future use, so I have made a small GUI to do that, found the wav files to be to large
so now I've made it so that it converts them to 32bit mp3's, I have tried them at 8bit their still intelligible
and very small, I've still yet to see what else can be done with it so will be a while before I can package it
so in the mean time I'll just post what I've done so far.

Here are the deb files that I used
http://http.us.debian.org/debian/pool/m ... 2_i386.deb
http://http.us.debian.org/debian/pool/m ... 2_i386.deb

code for the GUI
EDIT UPDATE V2 for testing:
now have radiobuttons to select voice's and bit-rate
mp3 file naming, now you can type with spaces, it automatically replaces them with "_".
EDIT: cleaned up the script to make it clearer to read

EDIT: V2.1 added save as wav option and mp3 id tags, updated code below.
EDIT: V2.2 see other post for changes
EDIT: V2.3 rewrote to use with gtkdialog4
Attachments
flitegui2.3.png
(18.83 KiB) Downloaded 1185 times
flitegui-2.3.tar.gz
Extract and place in /usr/bin
(2.29 KiB) Downloaded 650 times
theme_Xfce-dusk.png
(20.58 KiB) Downloaded 2722 times
flite_text_recorder_v2.2_.tar.gz
Version 2.2
(2.14 KiB) Downloaded 927 times
Last edited by Geoffrey on Thu 24 Jan 2013, 04:50, edited 6 times in total.

stu90

#2 Post by stu90 »

Nice work Geoffrey - i packaged it all up into a .pet so people can try it, should have a menu entry in document.

http://smokey01.com/stu90/lucid.puppy.p ... _1.4-2.pet

cheers

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#3 Post by Geoffrey »

stu90,

thanks for that, I would of got around to doing it but I'm still seeing what else can be done with flite.

Was thinking of adding a input box or buttons for the mp3 bit-rate, that might be useful, also small buttons to select the voice.

32bit seem ok, it reduced the size of a 44meg wav file down to 5.5meg mp3

8 bit was ok too, so I'm thinking maybe buttons for 8, 16, 32 bit would be good for small portable players

Trying to keep it more mouse driven than keyboard

though I have yet to find a way to do that me being a novice at this type of thing.

I'd like to keep it all in the one script if at all possible.

I was thinking of a post-install script in the pet announcing that flite had been installed and where to find the GUI.

Well if you have it may as well use it, I say!

The talking clock is easy enough, just have to place a script in /usr/bin/

just name the script flitetime

Code: Select all

#!/bin/sh
flite_time `date +%H:%M`
to get pschedule to run it on the hour place a file called "root", (I'm guessing that's the username) in /var/spool/cron/crontabs/ with this text

Code: Select all

0 * * * * flitetime # # # #
or either set it with pschedule gui.

Any input from others will be appreciated

Geoffrey

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#4 Post by Lobster »

Good stuff 8)

For consideration
help pop up so we know what different voices are, authoring etc

Code: Select all

   <menuitem>
           <label>FAQ</label>
           <action>`Xdialog --wrap --screencenter --left --title "FAQ" --msgbox "this is an example \n put text here \n more lines</action>
         </menuitem>
offer also espeak or other text convertor option - or separate program?
http://www.murga-linux.com/puppy/viewto ... 817#508817

keep program open, for multiple file conversion

if unsure of how to program further use programming section of forum

hope that helps
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#5 Post by Geoffrey »

Lobster,

I've tidied it up a bit, removed the frames to tighten it up, made the voice list selectable,
so now just highlight the voice you want then click on it and drag it to the input box.

It now restarts after a recording and if the media player is selected it restarts after the play is closed, so it seems quite good now,
the mouse does all the work only have to type a name, then that could be cut a pasted.

added a xdialog popup as you suggested, though I still have to give it some content.

There isn't all that much info on the voices, other than male, female, American, Scottish.

I've made a flv of it in action, I'll update the first post when I've done the popup

Geoffrey
Attachments
flite_gui.png
(23.55 KiB) Downloaded 3064 times

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#6 Post by Geoffrey »

Well I've changed it quite a lot, now have radiobuttons to select voice's and bit-rate.

fixed the mp3 file naming, now you can type with spaces, it automatically replaces them with "_".

It's looking good, still haven't added anything to the xdialog popup, uploading it for testing,
to see if anyone can find a bug, I,m calling this one version 2.

I will update the first post with the code , tar.gz and the picture

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#7 Post by Geoffrey »

Another update, added save as wav file option and mp3 id tags

see first post.

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#8 Post by Geoffrey »

My next update, V2.2 it's such a pain trying to find a theme that suits as the buttons don't always aline
like I would like them to, so this is the best I can do for the time being.

Anyway so far I've rearranged it slightly, added the ability to listen to the voice's with a sample text,
removed the default voice from the list as it sounds the same as KAL, not the best choice, KAL16 is not
much better, I find AWB the Male Scottish, RMS Male US and SLT Female US the most pleasing,
If I had to pick one it would be RMS, the Male US voice as being the most fluent

also added that when a WAV is recorded it also creates a corresponding txt file in the save dir with the
same information as a mp3 id tag, thought that might be handy, as well as mouse over tool-tip text for the gui.
moved the Quit button away from the record, I kept hitting it by mistake.

As I said when I first started this I'm only a novice, so it may not work as some would expect, I firstly
made it as a one off converter which was supposed to be run when needed but, it does rerun the gui but
doesn't totally close thus leaves a bash script still running which will increment each time until the gui
is quit, I don't know how to get around this, I'm still learning, so any input would be appreciated.

Updating to V2.2, I'm removing the code as it takes up to much room, really no point in having it there.

See first post.

Geoffrey

User avatar
eztuxer
Posts: 494
Joined: Thu 06 Nov 2008, 11:19
Location: Hungary
Contact:

#9 Post by eztuxer »

Thank you Geoffrey, Stu90, and Lobster.
This is just what I wanted, so I can "read" while driving, or doing the dishes.
I found out I had to place the text file in root directory for it to work.
Probably because the dir it was in had some spaces in it.
This is a great app the voice sounds almost natural.
Is there a sexy airport public announcement female voice that I can patch in ? 8)
Don't poop it down... Pup it Up !

Egorio
Posts: 3
Joined: Wed 31 Aug 2011, 09:41

#10 Post by Egorio »

Geoffrey, excellent work! are you going to add any new voices?
Benefits of Using a [url=http://www.tecmetic.com/benefits-using-mobile-phone-signal-booster/]Mobile Phone Signal Booster[/url]
[url=http://recit.org/marc/wakka.php?wiki=FactsAboutMobilePhoneSignalBooster]Facts About Mobile Phone Signal Booster[/url]

gcmartin

#11 Post by gcmartin »

I find this is an interesting addition to Puppy.

Question

Is there a tool somewhere that anyone would recommend for using Puppy in creating your own voice(s) for use with Flite?

Thanks in advance

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

#12 Post by jrb »

Well done Geoffrey.
I've been working with Festival lately with the Nitech voices and noticed that Flite was listed with those same voices. I find the rms voice is listenable. So I checked http://www.wellminded.com/puppy/pupsearch.html and here was your package. Very Nice. :D

I've taken the liberty to update Stu's dotpet with flitegui-2.2:
flite-gui_1.4-2.2.pet

Thanks, J

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#13 Post by Geoffrey »

jrb wrote:Well done Geoffrey.
I've been working with Festival lately with the Nitech voices and noticed that Flite was listed with those same voices. I find the rms voice is listenable. So I checked http://www.wellminded.com/puppy/pupsearch.html and here was your package. Very Nice. :D

I've taken the liberty to update Stu's dotpet with flitegui-2.2:
flite-gui_1.4-2.2.pet

Thanks, J
I'd forgot all about it, yeah works ok but I guess the voices can be a little irritating. now I can see how it could be made to look a little better and improve the functionality, though I think it does the job ok as it is. I would of liked more voices but I'm afraid that's it, flite-1.4-release was the last, updated 2009.
I'll see if I can improve it a little.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#14 Post by Master_wrong »

i have try some trick with sound for email:

for example in claws-mail:
in preference-receiving

click on run command on manual

script :
flite -t "you got %d new mail"
or
flite -voice slt -t "you got %d mail"

then computer will say it when you got mail

thanks
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#15 Post by Geoffrey »

I've rewrote the flitegui script to use gtkdialog4, it is now a lot tidier and has the ability to save the last used bitrate and voice as default.

Increased the bitrate range from 8, 16, 32 bit to 32, 96, 128 bit

Selecting a voice and pressing listen gives a sample by speaking the current date and year, right mouse click on the listen button stops the action.

see first post.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
Enrique Corbellini
Posts: 108
Joined: Wed 20 May 2009, 17:59

festival looks good

#16 Post by Enrique Corbellini »

when trying to install flitegui_1.4-2-2 pet in slackopup it says "not possible to install it". I'm using yakitome.com in Spanish in the meantime, but it shouldn't be necessary to use the internet to have a text converted to good human voice (by the way, yakitome has a sweet female voice, difficult to improve). :wink:

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#17 Post by Puppyt »

Hi Geof -
thanks very much for your work here, unfortunately I can't get your flite gui's working in Pemasu's Upup 3.8.3.1. jrb's pet also loads up, but file conversion falls there also. I went to the ubuntu repo's and no luck there either with the official flite and flitelib installs. Do you want some sort of diagnostics to help solve the issue?
Cheers :)
Search engines for Puppy
[url]http://puppylinux.us/psearch.html[/url]; [url=https://cse.google.com/cse?cx=015995643981050743583%3Aabvzbibgzxo&q=#gsc.tab=0]Google Custom Search[/url]; [url]http://wellminded.net63.net/[/url] others TBA...

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#18 Post by Geoffrey »

Puppyt wrote:Hi Geof -
thanks very much for your work here, unfortunately I can't get your flite gui's working in Pemasu's Upup 3.8.3.1. jrb's pet also loads up, but file conversion falls there also. I went to the ubuntu repo's and no luck there either with the official flite and flitelib installs. Do you want some sort of diagnostics to help solve the issue?
Cheers :)
I downloaded Upup 3.8.3.1 to see what the problem was, installed jrb's pet, the old Gui don't work but replacing it with the gtkdialog4 version works fine, tested making wav and mp3 files, all appears to work ok.

you can change line 105 in the gtkdialog4 flitegui to read:

Code: Select all

exec defaultaudioplayer $DIR/$NEW_MP3_NAME.$file &
that will get pMusic to play it.
:)
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#19 Post by Puppyt »

Thanks Geoffrey!
That's you, going beyond the call, again, cheers! I'll look into the gtkdialog4 version again (flitegui-2.3.tar.gz - it was the first one I tried, but didn't seem to produce the MP3 at all). I've had troubles with other Flite versions, including ones downloaded via PPM in various puplets - has been a frustrating day. I just want to flick various docx files- converted to straight text - into mp3's to playback on my olde PocketPC2003 when I'm out walking. The hope is I can study and get the blood circulating simultaneously - maybe even do my exam preparations 'on the run'...
Cheers :)

EDIT:
Still no joy with v2.3. It loads fine, permits file selection and modification but when 'Record' is clicked, a SAVED [filename].mp3 message comes up instantly, only a strange [filename].mp3.txt file is generated. 'listen' button doesn't give the usual time speech - an ALSA problem perhaps? pMusic opens also, presumably to play the mp3 file that doesn't exist. Is there something wrong with my text file format? I've attached a copy of the file I'm trying to give voice to - perhaps someone might spot my problem?

EDIT2:
DOH :oops: Missed the obvious - had to install the v 2.2 pet FIRST to get the voices etc, and then overlay the flitegui in /usr/bin with the v 2.3 tar.gz. It wasn't until I tried to reinstall in MacPup520 which I also have on this laptop, that this error occurred to me. The pharmacological and latin pronunciations actually very good with the Scottish male voice - but I'll have to read along with the text first before I go out walking with this as a revision aid :) Discord over - thanks :)
Attachments
gcsummary2.txt.gz
not a gz - remove for text opening
(30.04 KiB) Downloaded 213 times
Search engines for Puppy
[url]http://puppylinux.us/psearch.html[/url]; [url=https://cse.google.com/cse?cx=015995643981050743583%3Aabvzbibgzxo&q=#gsc.tab=0]Google Custom Search[/url]; [url]http://wellminded.net63.net/[/url] others TBA...

Post Reply