The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => General UQM Discussion => Topic started by: PhracturedBlue on January 15, 2003, 10:48:51 pm



Title: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 15, 2003, 10:48:51 pm
Okay, I may  get yelled at for doing this, but ever since the first day I played UQM (about 2 months ago), it  has been bugging  me.

You know what I mean:  the voiceovers and subtiles don't go at the same rate.

Well, I've done lots of work on stuff since then, and from my point of view, one of the few remaining issues (from the user's perspective) is this synchronization problem.

I've been told others are working on it, and I've been told to wait  for the new resource system, but it's been two months, and I'm sick of waiting.

So here it is:  A tool that lets all you earn your keep by listening to the dozen or two hours of UQM voice-acting, and pressing a key ('n') each time a page of text has been spoken.

What you need to do is download my tool, and follow the directions.  Then send the collected data back to me, and I'll turn it into something that can be used for UQM.

You can decide amongst yourselves how to partition up the load, but  I'd like to get a few reults from different people for each ogg file (that way I can have reasonable confidence that the timestamp data is valid)

I have built a binary Windows version, but it should compile on any OS thathas SDL and libvorbis (both pre-requisites for UQM).  I have only tested it on linnux so far, and it works fine there.

Also, there are a few known issues with the tool, the code is a mess, and it leaks some memory (but not too much).  I may fix those up eventually, but for now, the data it produces seems to be fine.

Please let me know of any issues you may find, and don't go hog wild quite yet.  Bettter to just do a few, and send them to me so I can make sure everthing is workinng smoothly.

I should probably note, in case it isn't abundantly obvious, this will be a major spoiler if you haven't finished the game, as you will hear all of the text spoken byall of the races.

The windows binary  (230k):
http://www.phracturedblue.com/sc2/sync-0.12-win32.zip

the source (8k):
http://www.phracturedblue.com/sc2/sync-0.12.tgz

the README:

Ur-Quan Masters Voice-over synchronization tool

For Windows:
     Unpack into any directory.
     From a DOS prompt, execute Synchronizer.exx from within the UQM content
     directory it will write out files into content/timestamp/race
     When you are done, archive them, and send to:
           tcpaiqgvnmbf28f001@sneakemail.com

To use, select the files you want to play, and  hit start.
hitting 'n' is the same as 'Next Screen', and 'p' will pause/unpause.

Hitting 'space' or 'enter' may have adverse effects, so don't

For Linux:
     The code can be compiled with:
           gcc synch.cpp synchronizer.cpp audioSDL.cpp audio.cpp -o synch -DUSE_SDLAUDIO=1 -lfltk -lvorbisfile -lvorbis `sdl_config --cflags --libs`

     You'll need fltk (1.1.x), oggvorbis, and SDL development libraries
installed.

If you have any questions or issues, please send them to the e-mail above



Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 16, 2003, 07:03:22 am
Just a note:
I updated the linnks above to point at rev 0.11
Bug fixes for Win32 (nothing critical, but niceness things)
Also, Linux build now works for all you Linnux folks who want to get in on the action


Title: Re: Voiceover / Subtitle synchronization tool
Post by: WolfJaguar on January 16, 2003, 07:56:08 am
This is actually a cool idea on a sort of indirect way to solve this issue, though I'm pretty sure the team is working on a similar method, I think that's what it said in the dev notes. *shrug* I'd love to help but I wouldn't have the time. Though I've played through the game a billion and one times already. Good luck with this.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Captain Smith on January 16, 2003, 08:20:08 am
I was going to comment that the game was turning Japanese with the port, but you beat me to it  ;D

If you've listened to 80s pop you'll get the joke  ;)


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 16, 2003, 08:38:22 am
Quote
This is actually a cool idea on a sort of indirect way to solve this issue, though I'm pretty sure the team is working on a similar method, I think that's what it said in the dev notes. *shrug* I'd love to help but I wouldn't have the time. Though I've played through the game a billion and one times already. Good luck with this.

I am part of the 'team' :) (see my cool 'developer' status)

And there is another effort to develop a more comlex tool (which will also facilitate translations).  But as far as the subtitles go, this is the way we've decided to synchronize them:  Create timestamps for each of the ogg files, which will be used when playing subtitles to determine when to change pages


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Nic. on January 16, 2003, 08:59:36 am
Is it the intention for the time indices to "work both ways"?  e.g., if you hit the right arrow to skip to the next subtitle, you could also (in theory) seek to the appropriate frame in the OGG file, so that the voice and speech always match.

According to the documentation (http://www.xiph.org/ogg/vorbis/doc/vorbisfile/ov_time_seek.html), it's supposedly trivial to do. (yeah, right)

Just an idea.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: WolfJaguar on January 16, 2003, 09:05:41 am
Hum, well I thought the developer status might just mean you are a software dev guy in the biz :) My bad. In any case, good luck on your endeavers, I've really enjoyed the alpha test so far. Hasn't crashed yet!(Gotten about halfway through storyline)


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Cyamarin on January 16, 2003, 10:33:41 pm
I would love to do this.  My question is, is there a resource out there where I can examine the text and see where the page breaks are without having to actually get into the game and find that conversation?


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 17, 2003, 12:07:20 am
Quote
I would love to do this.  My question is, is there a resource out there where I can examine the text and see where the page breaks are without having to actually get into the game and find that conversation?


If you try my tool, you will see that it does this for you.  It shows you 1 screen of text.  All you need to do is press 'n' each time the voice finishes the current page, to advance to the next page.

It is very easy.




Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 17, 2003, 12:28:32 am
In case anyone was wondering how much voice acting there is in UQM:

total voice-acting: 11:23:01
-------------------
arilou : 21:17
black-urquan : 14:10
chmmr : 16:29
commander: 1:00:00
druuge: 31:45
ilwrath: 38:02
melnorm: 72:07
mycon: 12:15
orz: 35:25
pkunk: 45:14
shofixt: 8:13
slyland: 24:20
spathi: 46:28
supox: 14.36
syreen: 27:47
talkking-pet: 22:42
thraddash: 40:18
umgah: 20:21
green-urquan: 24:17
utwig: 45:40
vux: 21.22
yehat: 22:26
zoq-fot: 20:35


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Nic. on January 17, 2003, 01:19:20 am
If you call this project "UQM@Home", I'm sure you'll get LOTS of people signing up to send in results, all fake.  :)


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 17, 2003, 10:05:33 am
Another update.
I have updated the links above agian.  the new version will display how much time it will take to play the currently-selected tracks.  It also skips tracks which onlyhave a single page of text (since those dont require synchronization).

Also, I currently have results for:
Arilou
Black-Urquan
Mycon
Slylandro (and the probes)
Shofixti
Supox
Talking-Pet
Thraddash
Umgah
Green-urquan
Utwig
Vux
Yehat (and rebels)
Zoq-Fot-Pik


Title: Re: Voiceover / Subtitle synchronization tool
Post by: morokolli on January 17, 2003, 02:33:39 pm
Hi

I haven't had much time but I did some synchronizing a few days ago.

I have commander Hayes and Chmmr, I see they are not in your list.

I'll send them when I get home, hopefully..


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Daniel on January 17, 2003, 06:16:17 pm
Cool!  Unfortunately, it seems to have some problems in Linux.  I tried it out (after compiling it) on a number of different files, and it seems like it freezes after I finish playing the first sample. (whether I stop it manually, restart, or let it finish)  Specifically, it becomes unresponsive and consumes as much CPU time as possible, as if it had entered an infinite loop.

Also, I had to decrease the point at which it word-wrapped -- the default word-wrap point placed the text off the right-hand side of the screen.

Anyway, looking forward to captions that actually work :)

Daniel


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Death 999 on January 17, 2003, 06:59:07 pm
Quote
In case anyone was wondering how much voice acting there is in UQM:


I find it sad that the THRADDASH are ranked so high. They have a lot of amusing history to tell, though, so I guess they're worth it for the amusement value.

on the other hand, the Arilou seem to have relatively little speaking time...


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 17, 2003, 07:39:58 pm
Quote
Cool!  Unfortunately, it seems to have some problems in Linux.  I tried it out (after compiling it) on a number of different files, and it seems like it freezes after I finish playing the first sample. (whether I stop it manually, restart, or let it finish)  Specifically, it becomes unresponsive and consumes as much CPU time as possible, as if it had entered an infinite loop.

Also, I had to decrease the point at which it word-wrapped -- the default word-wrap point placed the text off the right-hand side of the screen.

Anyway, looking forward to captions that actually work :)

Daniel


Well, I have to admit that the Linux version is sort of a second-class citizen. I am not fmailiar enough with how audio, SDL, and Linux all work together, and since I do most of my UQM work on windows, that is my preferred platform.  I will take a look at th Linux version perhaps, but I'll probably be done with the initial sequencing before then :)  And yes, the word-wrapping is a crude hack.  fltk is not a wonderful toolkit for this sort of thing.



Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 17, 2003, 08:39:44 pm
Quote


I find it sad that the THRADDASH are ranked so high. They have a lot of amusing history to tell, though, so I guess they're worth it for the amusement value.

on the other hand, the Arilou seem to have relatively little speaking time...

Remember that the Thraddash speak pretty slowly
here's another piece of trivia: the zoq-fot-pik have nearly 300 voice files (4x most other races), but only 20 minutes of speaking.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Nic. on January 17, 2003, 09:49:05 pm
I've got dibs on the Spathi and Druuge.  Just finished the High Council, on to the starship captains.

BTW, to anyone interested in doing this, be ready for ALOT of false starts.  Synching subtitles takes some getting used to..


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 17, 2003, 10:00:18 pm
update:  The current version (0.12) doesn't include the syreen (oh dear).  If  you compile from source, just  add them to the list in synch.cpp.  Anyhow, I am doing them now.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: ErekLich on January 17, 2003, 10:25:08 pm
Plus with the Thraddash they have a lot of different dialouges, depending on how you tell them to make "Culture Twenty"...

They have all the rhymes if you choose that option, etc etc...

Anyway I'd love to help (as this annoys me as well) but doubt I could do anything in short order (and you seem to be almost done) sine college has started back up for me....
sigh...


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Cyamarin on January 18, 2003, 01:56:55 am
Who do you want me to do?  Let me know who's still left and I'll get right on it.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 18, 2003, 03:21:03 am
Quote
Who do you want me to do?  Let me know who's still left and I'll get right on it.

Choose a race from the list below (one that noone else has mentioned yet), post here that you are doing it, and go to town.  i reomend choosing the shorter races first as doing (for instance) the melnorme is not a good one to cut your teeth on.

When done, send it to me (via email) or IRC.

Obviously, we are making very good progress, and I expect to have all races complete tonight (that'd be within about 6 hours from right NOW, so we're not in dire need of help, but having multiple copies of the same data is not a bad thing.

I will probably post another version of the script once the initial timestamps are done, which will let one play-back the sample with timestamps, and make adjustments, so that tuning becomes easier, but for now, get a sample, and get cracking.
(and I claim the pkunk as my next victim)

races that have not yet been claimed/finished:
druuge: 31:45
ilwrath: 38:02
melnorm: 72:07
orz: 35:25




Title: Re: Voiceover / Subtitle synchronization tool
Post by: Nic. on January 18, 2003, 03:35:54 am
I already did the Druuge, and I'll elect to do the Ilwrath in a little bit.  That leaves:

melnorm: 72:07
orz: 35:25

To arms!  To arms!


Title: Re: Voiceover / Subtitle synchronization tool
Post by: HuffiMuffiGuffi on January 18, 2003, 03:46:38 am
I can do Druuge and Ilwrath and maybe some more this weekend while my girlfriend is away at work.  I'll have to do it on her computer though... gotta run home and burn UQM 0.12 to CD.  I love listening to the Ilwrath!  ;D

Now didn't you say you need multiple samples for each race to make sure we get the timings right?


Title: Re: Voiceover / Subtitle synchronization tool
Post by: HuffiMuffiGuffi on January 18, 2003, 03:52:23 am
Too much spare time is right.... LOL   :P


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 18, 2003, 04:45:21 am
Quote
Now didn't you say you need multiple samples for each race to make sure we get the timings right?


yes, the more the merrier :) however, it will probably be easier to go back and tweak the broken ones, than to try and choose from different versions.

Anyhow, I'll take anything i can get.

I am starting melnorm now, so we are down to the orz left up for grabs.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 18, 2003, 07:19:48 am
Okay, I think we are all done  :)  Thanks everyone for playing.
I am still waiting to receive :
ilwrath,
chmmr,
comandr,
starbas

(I beleive these have already been completed). so if you've done one of these, just send iton over.

Thnx again.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 19, 2003, 03:30:16 am
Alright, I just want to thank everyone who contributed to synchronizing the text.  WE ARE DONE!

I have checked in the code, and so the next release of UQM will have synced voices (for the most  part)

Thanks again!


Title: Re: Voiceover / Subtitle synchronization tool
Post by: WolfJaguar on January 19, 2003, 03:59:58 am
Well now that was quick work :) Congrats to everyone, that's so cool, is there an expected release date for the next build?


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 19, 2003, 04:53:05 am
Quote
Well now that was quick work :) Congrats to everyone, that's so cool, is there an expected release date for the next build?


When it is ready :)

Well actually, there has been discussion about doing another release, but in any case, expect new developer snapshots to be availiable once all the recent changes ave been flushed out.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: TrevorB on January 20, 2003, 07:24:57 am
PhracturedBlue.  For the record.. you rock.

I found out that the sychronization was done by reading the ChangeLog from CVS.  I went *WTF*?!?, read the thread here.  Then compiled and was amazed at the difference it made.  UQM is really "show-off" cool now.

You've accomplished months of work in 3 frigging days! Kudos.

If we could solve all the worlds problems by distributing files to everyone and getting them to hit the n key at the appropriate time, the world would be a much better place.

Kudos to all those *n* pushers too... :)  You're all freaks, and we love you for it.

Still awaiting UQM v1.1 (Let the modding commence!)  Until then, enjoying UQM v0.13....


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Daniel on January 20, 2003, 05:56:08 pm
I was just testing the new version (with sound/subtitle synchronization) and I quickly noticed that in the opening part of the discussion with Fwiffo, his speech starts out synchronized with the text, but slowly drifts behind it, so that (eg) the screen "..er..." appears and vanishes several seconds before he says "er".  Does anyone else see this?

Daniel


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 20, 2003, 06:30:31 pm
Quote
I was just testing the new version (with sound/subtitle synchronization) and I quickly noticed that in the opening part of the discussion with Fwiffo, his speech starts out synchronized with the text, but slowly drifts behind it, so that (eg) the screen "..er..." appears and vanishes several seconds before he says "er".  Does anyone else see this?

Daniel


Whatsystem are you using?
I have noticed that on my linux box using  sdl_mixer, the sync ends up  being off for longer dialogs,  but the exact same dialog works fine in openAL mode.
The only idea i can come up with, is that sdl_mixer is playing the sounds too slow.
Indeed with my wndows openal verison and linux sdl_mixer playing  side by side, the windows version plays fwifo's first voice-over almost 1 second faster.

This could be the difference between linux and windows, butI am more incluined to think itis the difference between openAL and sdl_mixer.

I will try building my linux version using openAL, and see if it makes a difference.

Update:
Okay i was wrong.  openAL behaves the same way (voices too slow) on my linux box.  I have no idea how to solve this, since it is a basic assumption that two systems will play audio at the same rate.

If anyone else (either using  windows or linux) wants to test out fwifo's openingstatement and see how it  aligns towards the end, that would be useful.



Title: Re: Voiceover / Subtitle synchronization tool
Post by: Nic. on January 20, 2003, 10:11:11 pm
I cannot reproduce this -- the Spathi subtitles synch up perfectly with the voice on my Linux box w/ OpenAL.

The Ogg Vorbis codec before the final release version (1.0) was quite slow and CPU-intensive.  If you're linking against one of the release candidates (rather than the final 1.0) under Linux, that might explain why the threads are going out of sync, but I'm mostly grasping at straws here.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Daniel on January 20, 2003, 10:53:00 pm
Quote
I cannot reproduce this -- the Spathi subtitles synch up perfectly with the voice on my Linux box w/ OpenAL.

The Ogg Vorbis codec before the final release version (1.0) was quite slow and CPU-intensive.  If you're linking against one of the release candidates (rather than the final 1.0) under Linux, that might explain why the threads are going out of sync, but I'm mostly grasping at straws here.


That's not it, I have the final 1.0.  (and my computer is fast enough to handle some fairly intensive calculations simultaneously with the game, I think)

I'm not sure whether the sync is actually drifting, or if there's a constant offset (it's hard since I don't know how the voice and audio are supposed to be)  If there's a constant offset, I wonder if there's a brief delay on Linux before the audio starts?

Daniel


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 20, 2003, 11:15:07 pm
Well, as I said, at least on my linux machine, the sound actually runs slower.  If I start the sounds at the same time, the subtitles switch together, but the linux machine just speaks slower.   I don't know the cause of this, and I will investigate further, but I cuold still use specs on your system (openAL/sdl_mixer, processor speed, linux version)

Thx.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Cyamarin on January 20, 2003, 11:42:18 pm
Heh...Boy, I'm just too slow.  And this was something I could really get into, too.


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Daniel on January 21, 2003, 12:22:54 am
Quote
Well, as I said, at least on my linux machine, the sound actually runs slower.  If I start the sounds at the same time, the subtitles switch together, but the linux machine just speaks slower.   I don't know the cause of this, and I will investigate further, but I cuold still use specs on your system (openAL/sdl_mixer, processor speed, linux version)

Thx.


The computer I originally noticed this on was a Pentium II running at 450 MHz (I think)  My own computer, which was broken this morning (monitor blew out, but I have a new one now), is an AMD Athlon (TBird, I believe) running at 1.1 GHz.  The Pentium II has an ESS Maestro based sound-card, while my computer has an ESS Solo.  Interestingly, my personal computer does not exhibit the bug I noticed, or if it does it manifests so subtly that I can't spot it.

Both computers are running Debian unstable, and in fact the binary is identical -- I compiled it on one and copied it to the other.

Daniel


Title: Re: Voiceover / Subtitle synchronization tool
Post by: PhracturedBlue on January 21, 2003, 08:24:05 am
Just for the record:
On my piii 1GHz machine, Fwifo's opening dialog plays for 56.3 seconds (that is an approximate, since it is hard to tell exactly when it starts/ends,but  is reproducable.)
On my pii 366, the track plays for 57.7 seconds (using the same method, and latest openAL libraries)

ogginfo says the sound should play for 56.7 seconds

On my  366, UQM (while doing this voiceover) consumes 98% CPU, so thiis may be part of the problem.

I have some ideas for optimizing the subtitle/animation which may reduce CPU usage and help out.  Maybe I'll start  working on that.

Also, as confirmation, the slider finishes noticably earlier than the voice-over on my linux box, but syncs very well on win32 (just another piece of evience that the audio is just playing too slow)


Title: Re: Voiceover / Subtitle synchronization tool
Post by: Daniel on January 30, 2003, 03:22:21 am
Quote


The computer I originally noticed this on was a Pentium II running at 450 MHz (I think)  My own computer, which was broken this morning (monitor blew out, but I have a new one now), is an AMD Athlon (TBird, I believe) running at 1.1 GHz.  The Pentium II has an ESS Maestro based sound-card, while my computer has an ESS Solo.  Interestingly, my personal computer does not exhibit the bug I noticed, or if it does it manifests so subtly that I can't spot it.
l


It just occured to me that I left out a difference which could be very relevant.  Both computers are running kernel 2.4.20; however, the one which exhibits the bug is using the standard sound drivers; my own computer uses ALSA.  This may be a red herring, but it's worth mentioning IMO.

Daniel


Title: Re: Voiceover / Subtitle synchronization tool
Post by: GermanNightmare on February 04, 2003, 03:27:55 am
Ahhh - here is the thread I was locking for earlier - Sorry PhracturedBlue

Another thing I just noticed is that the Yehat are talking to me but they do not show any text... (in the game)

Maybe my installed version is not up to date? Don't know...

I just wanted to say "Thank you" to you and your little "n-pressing" helpers. Looks like I joined in way too late to make a difference here (although pressing a button at the right time is just what I can manage to do - programming is nothing I know of)

Any advice?

P.S.: Soooo good to be aboard a Precursor vessel after 10 years of absence!!!