#126471 - 16/11/2002 13:24
Prerecorded TTS and the empeg
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
Reading the PhatBox thread got me pretty interested in TTS on the empeg. I'm trying to create a simple program for the empeg that will speak out loud the date and time a few seconds after ignition before the player app starts. I'm trying to do it as a bash script with the help of the pcmplay program and setvol. When finished it can be installed as a preinit script or as a modified init and the empeg can say "Welcome. Today is Saturday November 16. The time is 3:09" a few seconds after you turn on the car.
I've already created all the pcm audio files it would need to string together the sentence. I've used the $200 developer version of AT&T natural voices program to do so using the "Crystal" voice, so its a very high quality tts voice. An online demo of it is available at http://www.naturalvoices.com/demos/index.html
So now all I need to do is create the bash script to string together the sentence based on the date and time. I was looking at http://www.tldp.org/LDP/abs/html/timedate.html#EX51 for info on how to get the date and time, but this just doesn't work under the empeg, probably because it wasn't included with the kernel installation. So does anyone know how to get bash to return the date and time in a script using the empeg? Maybe someone has the date and time command compiled as part of another arm linux package that could run on the empeg?
On a seperate note I could easily create a windows program that would take the empeg database (CSV file) and export prerecorded TTS to pcm, wav, or mp3. I could make it export the name of each artist, album, and title to audio files. I have pretty much all the source code I need to do this in very little time (see my software at www.zabaware.com) It would be minor work for me to read in the CSV file to export all the fields as audio files.
But I don't have enough linux experience to be able to write any useful TTS app for the empeg. But knowing that I volunteer to make a windows program that creates prerecorded TTS audio files based on any set of data, is there any linux programmer out there interested in creating some usefull TTS app for the empeg?
|
Top
|
|
|
|
#126472 - 16/11/2002 14:00
Re: Prerecorded TTS and the empeg
[Re: DomoKun]
|
pooh-bah
Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
|
Don't recall where I got it, but I've attached the `date´ binary to this post - hopefully it survives without any CRLF translations mucking it up.
Assign the string returned by the date command (encolse in back-ticks) to a variable and parse out the parts (or make repeated calls with different format parameters to get the various parts). The man page for date is here.
In general, deb-packages (they're 2 tar.gz files ar'ed together) can be found via the Debian homepage, http://www.debian.org
/Michael
Attachments
125376-date (406 downloads)
_________________________
/Michael
|
Top
|
|
|
|
#126473 - 16/11/2002 14:47
Re: Prerecorded TTS and the empeg
[Re: DomoKun]
|
old hand
Registered: 30/04/2001
Posts: 745
Loc: In The Village or sometimes: A...
|
In reply to:
On a seperate note I could easily create a windows program that would take the empeg database (CSV file) and export prerecorded TTS to pcm, wav, or mp3. I could make it export the name of each artist, album, and title to audio files. I have pretty much all the source code I need to do this in very little time (see my software at www.zabaware.com) It would be minor work for me to read in the CSV file to export all the fields as audio files.
But I don't have enough linux experience to be able to write any useful TTS app for the empeg. But knowing that I volunteer to make a windows program that creates prerecorded TTS audio files based on any set of data, is there any linux programmer out there interested in creating some usefull TTS app for the empeg?
Hi, interesting ideas, if you were to create PCM versions (at 44.1Khz sample rate), of all the songs in the CSV file, then you could esaily output these on the empeg as the DSP takes PCM files, and the pcmplay (and setvol) utilities can be used.
Note, if you name the PCM files using the FID of the tune (which I assume is available in the CSV file format exported by Emplode - if not then the XML version has FIDs in it), then it is easy to find the FID of the currently playing song, so you could then "mix" the PCM audio pre-spoken title of the song in to the audio stream.
However, that won't help with the speaking while browsing capabilities that the phatbox has.
The long term solution is to have a TTS engine on the Empeg, but that may require a lot of CPU for a real time spoken song titles as they play solution.
However a interim step may be to have a "on empeg" TTS engine and have it run automatically (or manually) run anytime that the tune database changed to rebuild the spoken title/playlist database. (i.e. do what emplode does during its database rebuild but for the spoken track names.)
|
Top
|
|
|
|
#126474 - 16/11/2002 18:41
Re: Prerecorded TTS and the empeg
[Re: number6]
|
Carpal Tunnel
Registered: 08/02/2002
Posts: 3411
|
There's something to be said for TTS on the PC vs on the empeg. It would remove the overhead of processing each time the FID is referenced, which since the output is going to be the same each time is just wasteful of CPU cycles.
Another advantage is that it would give users the chance to preaudition and correct pronunciations before download - making a 'live' TTS behave differently for a particular trackname isn't going to fly. (That could be gotten around by using a different field to trackname... (eg a 'SayAs' field) as the TTS input, but audtioning and changing this field could be tiresome...unless the TTS engine was also on the PC, which is duplication that could be avoided..)
Sure, the first time that you enabled TTS would involve a long TTS translation and download process, but after that, adding TTS prounciations for newly added tracks would be relatively painless.
_________________________
Mk2a 60GB Blue. Serial 030102962
sig.mp3: File Format not Valid.
|
Top
|
|
|
|
#126475 - 16/11/2002 22:23
TTS Clock r1
[Re: mtempsch]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
Thank you very much for the date binary. I have now completed the bash script now and it works very nicely. It is available for download at http://www.zabaware.com/empeg if anyone is interested in installing this on their empeg. If anyone notices any bugs or has suggestions please tell me.
|
Top
|
|
|
|
#126476 - 16/11/2002 23:36
Re: Prerecorded TTS and the empeg
[Re: number6]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
Even if someone managed to port a linux tts engine such as festival to the empeg, I still think that prerecorded tts is a better solution. You pretty much know in advance what its going to say so there is no point in forcing the cpu to do that. And also tts voices for windows are currently of higher quality then the linux ones, especially the AT&T natural voices and even the voices by L&H, IBM, and Microsoft.
The CSV file does contain the FID for each song, so pcm files with the same FID can be created. I believe in order to get TTS to work on the empeg just a few changes need to be made to hijack:
1. It would need to monitor what the current song playing is
2. When the song changes to a new song it should see if a pcm file with the same FID exists in the tts folder (the tts folder should be a config.ini option)
3. If a pcm file for that FID exists it should send the pause key to the player to prevent the new song from starting right away.
4. It should then play the pcm file.
5. After the pcm file finishes playing it should send the pause key to the player again to resume playback of the song.
Well if anyone is willing to handle that linux side of this give me the word and I'll have the windows side of it (CSV to TTS to PCM) working in less then a week:
The actual text spoken in the pcm file, the voice engine and font used, and the speech tempo will all be customizable by the user. So one person can have the female British English from L&H say "Now playing %title% by %artist%" and another user can have the "Mike" voice from Microsoft say "Playing track %track% from %album% by %artist%. %title%" It will also give the option of teaching it to pronounce certain words that it mispronounces.
Most engines except the ones by IBM and AT&T as far as I know are capable of writing the TTS to a file much faster then they normally speak. So it actually shouldn't more then a couple of minutes to convert the CSV music database into PCM files.
Also, most TTS engines for windows have a 11Khz sample rate, with some being at 8, 16, and 22Khz. They are all mono. If someone could make a version of pcmplay that can play 11Khz mono instead of 44Khz stereo that would save a lot of wasted space, the file size of the pcm would be 8 times smaller and there would be no change in quality.
What is the interest level in the empeg community to getting TTS as I described working?
|
Top
|
|
|
|
#126477 - 17/11/2002 02:03
Re: TTS Clock r1
[Re: DomoKun]
|
enthusiast
Registered: 14/05/2001
Posts: 279
|
I tried but it didn't seem to work very well for me.
I hear "Welcome. Today..." by then the player has started playing. The text can be heard stuttering over the music. The player also seems to go slower while it stutters.
Tom
|
Top
|
|
|
|
#126478 - 17/11/2002 07:40
Re: TTS Clock r1
[Re: charcoalgray99]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
I actually installed it as a custom init on mine without the aid of preinit. I looked through the preinit documentation and saw my mistake. Preinit doesn't wait for 'M' scripts to execute before launching the player. 'B' scripts are for that. Rename the file M10tts to B10tts and it should work. I'd reccomend testing the script from the command line before rebooting to make sure it works, because if something is wrong with a 'B' script it would render it unbootable and force you reflash the kernel. Make sure the script has permissions and just type "B10tts" and it should speak the time and return to the bash prompt. If it works then you're safe to reboot.
I have posted an updated version so all downloads from now on will have the file as a 'B' script.
|
Top
|
|
|
|
#126479 - 17/11/2002 08:34
Re: Prerecorded TTS and the empeg
[Re: DomoKun]
|
old hand
Registered: 12/01/2000
Posts: 1079
Loc: Dallas, TX
|
Ok, where is Mark Lord at? :-)
|
Top
|
|
|
|
#126480 - 17/11/2002 10:38
TTS Clock r2
[Re: DomoKun]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
Ok, I posted a new version of the TTS Clock program at http://www.zabaware.com/empeg/ that fixes several bugs. Sorry about the bugs, I should have tested it a little more before I posted it. Everything should work fine now.
|
Top
|
|
|
|
#126481 - 17/11/2002 11:10
Re: TTS Clock r2
[Re: DomoKun]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
sh-2.03# ./B10tts
/dev/empeg_state: Device or resource busy
cat: /drive0/var/tts/month07.pcm: No such file or directory
cat: /drive0/var/tts/: Is a directory
cat: 8th.pcm: No such file or directory
I tried renaming the month7.pcm to month07.pcm and that part worked fine, but it still didn't say the day and still got the error for8th.pcm
And yes I know my date is wrong, one thing at a time
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126482 - 17/11/2002 11:51
Re: TTS Clock r2
[Re: leftyfb]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
My other problem is, drive0 is not mounted yet when this script is being exectuted. I can only run this manually.
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126483 - 17/11/2002 12:14
Re: TTS Clock r2
[Re: leftyfb]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
From more testing I renamed B10tts to M10tts and it runs, but I don't hear anything. It runs fine manually still.
Another problem is it reading from the 24 hour format (14:11 reads as "Four Eleven")
I'd actually prefer to have my empeg read in 12 hour format, but can't seem to figure out how to do that. I set it in the settings to 12 hour, but in setting the time it still shows/allows me to set in 24 hour format.
A feature that goes along with this would be to say "PM" or "AM" at the end accordingly.
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126484 - 17/11/2002 12:15
Re: TTS Clock r2
[Re: leftyfb]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
I posted a newer version of the script at http://www.zabaware.com/empeg/B10tts and updated the zip file. It now works when month is < 10 day is < 10 and hour < 10 and minute < 10. You can rename the 08 file back to 8. Be careful of CRLF translations if you just download the script instead of the whole zip.
I already had a custom init without preinit installed, so I'm not actually using preinit. I'm just adding this code to my modifeid init and it works for me. Can anyone tell me more about preinit? If B scripts are run before mounting and M scripts are run concurrently to the player is there any other type that will run after the disks are mounted but force the player to wait until it finishes executing? Or should I just add the mounting code to the B script?
|
Top
|
|
|
|
#126486 - 17/11/2002 13:16
Re: TTS Clock r2
[Re: DomoKun]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
That code did work, Thanks!
Yet another problem..
It tried saying the time for 5:09 and all it got was "five o"
the error it generated was:
./B10tts: let: 09: value too great for base (error token is "09")
./B10tts: let: 09: value too great for base (error token is "09")
/dev/empeg_state: Device or resource busy
cat: /drive0/var/tts/09.pcm: No such file or directory
just a little FYI for myself, whats it trying to do and what goes wrong when it says: /dev/empeg_state: Device or resource busy ?
Edited by leftyfb (17/11/2002 13:32)
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126487 - 17/11/2002 13:45
Re: TTS Clock r2
[Re: leftyfb]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
ok, i'm noticing something strange. I had the time set to 15:35 and the clock format set to 12 hour. Rebooted and everything was working great with correct time. Rebooted again, still fine. Rebooted again, The time displayed is correct, setting it is correct, but the TTs is reading "five thirty five". Going in through telnet and creating a directory gives it the time of 17:35
Whats going on? I don't think this is an issue with TTS, but with empeg clock issues?
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126488 - 17/11/2002 13:48
Re: TTS Clock r2
[Re: leftyfb]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
Its seems the line "let minute=minute+0" is not a viable method for converting "09" to just "9" Its causing the "value too great for base" error and is the reason it didn't say the minute for you. I'll have to come up with another method to do that and I'll post an update here shortly once I do that.
As for the message "/dev/empeg_state: Device or resource busy" I think that is something Mark Lord's setvol program is saying, which could be a big problem. I don't get that message in my custom init. The setvol program is trying to read what the volume was set at when you last turned off the empeg so that it can use that volume level. If its not able to read it I'm not sure what level its setting your volume to. In DC car mode it might keep the volume at 0% and you won't be able to hear it, or possibly it might set it to 100% and blast your head off. Can you run setvol from the command line with no problems?
And as for it being 2 hours behind that is because the player software has its own timezone setting that this program can't read. The only way around this that I see is to set your timezone as "Universal" or "UTC" in the empeg player app and then set your clock accordinly.
|
Top
|
|
|
|
#126489 - 17/11/2002 14:02
Re: TTS Clock r2
[Re: DomoKun]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
Ok, so far setting it to Universal Timezone seems to be working ok. We'll see how that stays.
I tried running the setvol binary manually and get the same error: "/dev/empeg_state: Device or resource busy"
Not sure if you saw my suggestion/request in one of my previous posts about it saying AM or PM at the end of the time. Is this do-able?
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126490 - 17/11/2002 14:46
Re: TTS Clock r2
[Re: leftyfb]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
Sure, I'll add AM/PM to it.
I'm a little stuck right now with the error when the minute is 9 or 8. The funny thing is if the minute is 0,1,2,3,4,5,6, or 7 my method of removing the extra 0 works. But when the minute is 8 or 9, it produces an error.
Try this command at the bash prompt:
echo $(( 03 + 0 ))
That will return 3
echo $(( 07 + 0 ))
will return 7
but
echo $(( 08 + 0 ))
will return 08: value too great for base (error token is "08")
and
echo $(( 09 + 0 ))
will return 09: value too great for base (error token is "09")
Can anyone think of an alternate method of removing an extra 0?
Can anyone think of why setvol doesn't seem to work for leftyfb?
|
Top
|
|
|
|
#126491 - 17/11/2002 15:00
Re: TTS Clock r2
[Re: DomoKun]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
A number that starts with a zero is interpreted as being in octal. I haven't really looked at your script to tell you how you should be solving this problem, but that's the cause of this error.
Edit: However, if you've got a variable, let's say $i, that's in the form 00, 01, 02, ..., 09, 10, 11, ..., and you want to strip a possible leading zero, then using the expansion ${i#0} would be the best way.
Edited by wfaulk (17/11/2002 15:05)
_________________________
Bitt Faulk
|
Top
|
|
|
|
#126492 - 17/11/2002 15:49
Rsync and TTS
[Re: leftyfb]
|
journeyman
Registered: 25/05/2002
Posts: 55
Loc: Grove City, OH, USA
|
Remember, that if you are using rsync, make sure you set up the script on the empeg to exclude the three files in /drive0/var and to exclude the tts directrory
--exclude=date \
--exclude=pcmplay \
--exclude=setvol \
--exclude=tts \
The above works for me.
Oh and I am really enjoying the app.
|
Top
|
|
|
|
#126493 - 17/11/2002 18:27
Re: TTS Clock r2
[Re: DomoKun]
|
old hand
Registered: 16/02/2002
Posts: 867
Loc: Oxford, UK
|
I've installed your app but I am not setup to listen to the player indoors, doh! Everything appears to work ok, at least, my player doesn't crash etc. Here's hoping for wry smile when I dock the player in the car tomorrow morning on my way to work, thanks
Anyhow, the real point to my post is..... Have you received any offers of help with the Linux part of playlist TTS yet or has there been any further developments there on your part? You KNOW you want to become a Linux programmer don't you
|
Top
|
|
|
|
#126494 - 17/11/2002 19:17
TTS Clock r3
[Re: wfaulk]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
Thanks for the code. I've now updated the script so it can now say August, September, 8 AM, 9 AM, and the minutes 08 and 09 because there was a bug that prevented it from speaking those particular numbers. It now also speaks "AM" and "PM" outloud.
It is available as TTS Clock r3 now at http://www.zabaware.com/empeg
For people that already installed a previous version if you don't want to download the whole package again you can just update the script which is at http://www.zabaware.com/empeg/B10tts (be careful of CRLF) and add the AM/PM sounds to the TTS folder which are at http://www.zabaware.com/empeg/am.pcm and http://www.zabaware.com/empeg/pm.pcm
|
Top
|
|
|
|
#126495 - 17/11/2002 19:34
Re: TTS Clock r2
[Re: AndrewT]
|
journeyman
Registered: 14/03/2002
Posts: 94
Loc: Pennsylvania
|
In reply to:
Anyhow, the real point to my post is..... Have you received any offers of help with the Linux part of playlist TTS yet or has there been any further developments there on your part? You KNOW you want to become a Linux programmer don't you
No one has offered to help out with this yet, but hopefully someone does soon. I'm slowly but surely learning my way around Linux, most of which I can attribute to the empeg One of these days I'll have to try setting up a cross compiler to see if I can compile something for the empeg in c++
|
Top
|
|
|
|
#126496 - 17/11/2002 21:19
Re: TTS Clock r2
[Re: DomoKun]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
This is great!
It all works just fine now.
Thought of another idea. Instead of welcome, maybe from midnight to 11:59am it could say "Good Morning", from Noon to 6pm "Good Afternoon" and from 6pm to Midnight "Good Evening" ?
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126497 - 17/11/2002 21:30
Re: TTS Clock r2
[Re: leftyfb]
|
journeyman
Registered: 25/05/2002
Posts: 55
Loc: Grove City, OH, USA
|
It won't work for me. As in, it is always AM. What did I do wrong? I saved the script onto the empeg and put the am.pcm and pm.pcm files in the tts folder.
|
Top
|
|
|
|
#126498 - 17/11/2002 21:33
Re: TTS Clock r2
[Re: MP3944]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
You know, upon futher testing (setting the correct time AGAIN), it is always saying AM on mine also.
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
#126500 - 17/11/2002 22:51
Re: TTS Clock r2
[Re: DomoKun]
|
enthusiast
Registered: 04/03/2002
Posts: 217
Loc: Lowell, MA
|
PM now works. (this guy is good )
But alas, another bug. "Welcome, today is Monday, November 18th. The time is clock:43PM" As opposed to 12:43PM. I tried copying 12.pcm to 00.pcm with no luck. So much for trying to fix it myself this time
_________________________
Mk2a 30GB Blue. Serial 030102999
|
Top
|
|
|
|
|
|