The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: Geoffrey Hausheer on November 16, 2002, 04:12:42 pm

Title: Syncing Voice and text
Post by: Geoffrey Hausheer on November 16, 2002, 04:12:42 pm
I was looking at the source code to determine how easy it would be to sync the voice tracks with the text, and it looks really hard.  The main proleem being that each speech is one .ogg file, and thus there is no correspondance between a screen full of info and the voice-over.
As far as I can tell, there are two options:
1) Seperate all voice tracks into 1 file per screen (i.e. each .ogg would match one linne in the .txt file)
2) Add a field to the text file (or a suibtable new file) describing how long each line takes to play

Both would take a lot of time, but I think (1) would be easier, and also more robust.  It would also allow the user to skip a section of the voice-over, but here a later section of the same speech.

I'd be willinng to take a crack at gettinng the implementation to work, but there's no way I'd  have time to split all of the .ogg files up.

Are there any opinions on this?

Title: Re: Syncing Voice and text
Post by: Geoffrey Hausheer on November 16, 2002, 05:09:38 pm
I should probably note that  I've just started looking at  the source, and don't really understand the big picture yet.  After a bit more digging, it  appears the problem is more fundamental than I thought, since the 'scope and slider depend on actually getting info back from the voice-over audio handler (Ive never played the 3DO version, so I don't know what the slider does, but I assume it shows the progress of the voice-over).  Getting that  to work doesn't seem like it should be too hard.  makinng the 'scope be accurate is way beyond my comprehension right now, but making it display random waveforms may be doable (I have no idea what it was displaying for th PC version of the game).  In either case, I haven't actually looked at thatportion of the code, I'm just skimming through sections and seeinghow they're related.

Anyhow, all I guess I'm saying is "I'm new here, be gentle"

Title: Re: Syncing Voice and text
Post by: Parker on November 16, 2002, 05:23:36 pm
I believe your first idea would not be a good option, as it wouldn't match the 3DO game's behavior when it comes to seeking through the sound file.

Someone has suggested in the IRC channel an idea similar to your #2.  They suggested coding a small "timestamping" application which would add timestamps to the text files, based on user input (user would hit a certain key, while playing the game and conversing with aliens, that would add a timestamp at the same line of text, to correspond with the voice)

Title: Re: Syncing Voice and text
Post by: Geoffrey Hausheer on November 16, 2002, 06:47:45 pm
If #2 is the better option (having never used 3DO, i wouldn't know), my recomendation would be to use a tiny app to just display the text and play the music, so that we could do all the text, without having to play through the game.  Just drag all of Urquan onto the app, along with the .txt file, and in 10 minutes the urquan is sequenced.

I'll look into it some more, and maybe take a crack at a quick-and-dirty implementation tommorow if I get the chance.

Title: Re: Syncing Voice and text
Post by: Michael Martin on November 17, 2002, 04:58:45 am
I'm given to understand that the one who goes by 'Epitaph' on the IRC channel is in fact working on just such an application already.  Check with him before diving in.

Title: Re: Syncing Voice and text
Post by: Maphisto on November 20, 2002, 01:11:03 pm
the scope for the PC version was in fact displaying the waveform of the currently playing sound.  now I don't know much about coding for sound but it seems to me that the scope is nothing but a visual representation fo the current sound buffer.  There should be a way of reading that buffer through SDL sound or whatever you happen to be using, or by creating a prebuffer in software and plotting the waveform from there before it's sent to the sound device itself.  That would put the scope a little ahead of the actual sound but not enough to be noticeable.  However, reading the buffer after it's been commited may introduce skips if the device finishes the sample before a new one is available.  I'm sure there's probably an easier way to do it, but like i said, I don't code for sound.

Title: Re: Syncing Voice and text
Post by: Francisco on December 02, 2002, 12:51:39 am
This is a suggestion just incase it wasn't considered.

Implement an option to have the text progress differently (regular intervals?) if the 3DO voice is turned off, possibly mimicking the timing of the PC version.