Adventure Game Studio

Community => Adventure Related Talk & Chat => Topic started by: Janik on Mon 31/10/2005 03:17:48

Title: Resource for lip synching to voice
Post by: Janik on Mon 31/10/2005 03:17:48
Hi everybody,

I found this interesting program called Magpie that is used for synching lip movement to voice:

http://www.thirdwishsoftware.com/magpiepro.html

It is similar to the Pamela program, but more powerful. It is commercial (and expensive :( ) but there is a trial version to play with. The Pro version in particular has a really cool feature: automatic lip synching! It evaluates from the speech file where the phonemes should go, and it looks like it's right 95% of the time or so, depending on the recording quality.

The output of Magpie Pro is not directly compatible with AGS, because AGS expects a Pamela-format file. So I've made a custom file export script for Magpie. By placing this file:

http://www.dmgenie.com/ags/export-pamela.lua

in your \Magpie Pro\Scripts\Export\ folder, you will be able to export directly to a format readable by AGS.

Anyway, I hope this comes in handy for some people. It's a pretty neat program, I think it's worth checking out the trial version.


...


Since the script is short and my link may not be valid forever, here is the script code directly, for future reference:
export = {}; -- create a new export object

-- return label
function export:label()
return "Pamela";
end

-- return category
function export:category()
return "2D";
end

-- return argument list
function export:options()
groups = {};
for a,actor in magpie.getactors() do
for g,group in magpie.getgroups(actor) do
table.insert(groups, group);
end
end
return {
{"group", "Group", "choice", table.concat(groups, "|")},
  {"moho_output_file", "Output File", "output_file", "Pamela files (*.pam)\tAll files (*.*)"}
};
end

-- perform the export
function export:run(from, to, options)
-- create an array of all the poses that are being exported
poses = magpie.getposes(options.group);

-- open output file
fd = io.open(options.moho_output_file, "wt");
if (fd == nil) then
return string.format("could not open '%s'", options.moho_output_file);
end

-- write header line to file
fd:write("[speech]\n");

-- write data to file
oldk = "";
for frame = from, to do
k = magpie.getgroupvalue(frame, options.group);
if (k ~= nil and oldk ~= k) then
fd:write(math.floor(frame*360/magpie.getframerate()) .. ":" .. string.gsub(k, "[^%.]+%.", "") .. "\n");
end
oldk = k;

-- update progress bar in main window
magpie.progress("Exporting...", (frame - from) / (to - from));
end

fd:write("\n");
fd:write("\n");

magpie.progress("", 0); -- close progress bar

fd:close(); -- close output file
end
Title: Re: Resource for lip synching to voice
Post by: Rui 'Trovatore' Pires on Mon 31/10/2005 09:22:23
Wow! Interesting. I'll up it to my site.
Title: Re: Resource for lip synching to voice
Post by: Elliott Hird on Mon 31/10/2005 09:29:20
Hope they don't see that :P
Title: Re: Resource for lip synching to voice
Post by: Rui 'Trovatore' Pires on Mon 31/10/2005 09:31:04
...hope who doesn't see what?
Title: Re: Resource for lip synching to voice
Post by: Gilbert on Mon 31/10/2005 09:31:51
Also, why? I don't see any problems.
Title: Re: Resource for lip synching to voice
Post by: Elliott Hird on Mon 31/10/2005 10:58:43
Hope they don't see you recommending using TRIALS for full use :P

and hope they don't see you making an export script for a competitors format :D
Title: Re: Resource for lip synching to voice
Post by: Gilbert on Mon 31/10/2005 11:07:47
What's the problem? Did he mention using the trial version like a full programme?

What you would do to it is your own responsibility, at least I don't see any sign of him suggesting the pirate of softwares, if you really like a programme after the 30 day trial you may actually pay for it.

Also, what's the problem in creating an export script for a competitor's format?
Title: Re: Resource for lip synching to voice
Post by: Janik on Mon 31/10/2005 16:39:59
I based this script off of one of those which come with the program, but I don't think that's a problem. Plus, if you have Magpie, you don't really need to use Pamela, so it's not like it would take any business away. In fact, I don't think it would load in Pamela (I haven't tried). It's just so that it can work with AGS directly.