Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable voice-based lipsync for Lucas-Arts speech style #2522

Open
ivan-mogilko opened this issue Aug 30, 2024 · 1 comment
Open

Enable voice-based lipsync for Lucas-Arts speech style #2522

ivan-mogilko opened this issue Aug 30, 2024 · 1 comment
Labels
context: game logic context: speech type: enhancement a suggestion or necessity to have something improved

Comments

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Aug 30, 2024

For unclear reasons the voice-based lipsync does not work with Lucas-Arts speech style.

I cannot imagine the reason, as the only difference are character animation and the way text is displayed, neither of that has any relevance to voice or lipsync, and text-based lipsync works with LA style. Could be an intentional restriction for obscure or obsolete reasons, but also could be a non-intentional oversight in code.

Need to investigate this and let voice-based lipsync work with LA style too.

@ivan-mogilko ivan-mogilko added type: enhancement a suggestion or necessity to have something improved context: game logic context: speech labels Aug 30, 2024
@ericoporto
Copy link
Member

Looking at the update code it looks like it can work with any kind of speech

ags/Engine/main/update.cpp

Lines 414 to 436 in 6ce71b4

if (curLipLine >= 0) {
// check voice lip sync
if (curLipLinePhoneme >= splipsync[curLipLine].numPhonemes) {
// the lip-sync has finished, so just stay idle
}
else
{
while ((curLipLinePhoneme < splipsync[curLipLine].numPhonemes) &&
((curLipLinePhoneme < 0) || (voice_pos_ms >= splipsync[curLipLine].endtimeoffs[curLipLinePhoneme])))
{
curLipLinePhoneme ++;
if (curLipLinePhoneme >= splipsync[curLipLine].numPhonemes)
facetalkframe = game.default_lipsync_frame;
else
facetalkframe = splipsync[curLipLine].frame[curLipLinePhoneme];
if (facetalkframe >= views[facetalkview].loops[facetalkloop].numFrames)
facetalkframe = 0;
updatedFrame |= 1;
}
}
}

I noticed the playvoicespeech code assumes sierra and it changes the specific type of sierra speech

bool play_voice_speech(int charid, int sndid)
{
// don't play speech if we're skipping a cutscene
if (!play.ShouldPlayVoiceSpeech())
return false;
String voice_file = get_cue_filename(charid, sndid);
if (!play_voice_clip_impl(voice_file, true, true))
return false;
int ii; // Compare the base file name to the .pam file name
curLipLine = -1; // See if we have voice lip sync for this line
curLipLinePhoneme = -1;
for (ii = 0; ii < numLipLines; ii++) {
if (voice_file.CompareNoCase(splipsync[ii].filename) == 0) {
curLipLine = ii;
break;
}
}
// if the lip-sync is being used for voice sync, disable
// the text-related lipsync
if (numLipLines > 0)
game.options[OPT_LIPSYNCTEXT] = 0;
// change Sierra w/bgrnd to Sierra without background when voice
// is available (for Tierra)
if ((game.options[OPT_SPEECHTYPE] == 2) && (play.no_textbg_when_voice > 0)) {
game.options[OPT_SPEECHTYPE] = 1;
play.no_textbg_when_voice = 2;
}
return true;
}

I think the easy approach would be to remove the error condition from the editor so it CAN build an Lucas-Arts style with voice lip sync and then fix where things breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: game logic context: speech type: enhancement a suggestion or necessity to have something improved
Projects
None yet
Development

No branches or pull requests

2 participants